Skip to content

Commit 87bccd2

Browse files
authored
Allow customization of properties (#19)
Fixes #18 Signed-off-by: Juraci Paixão Kröhling <[email protected]>
1 parent 4d29685 commit 87bccd2

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.goreleaser.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ builds:
3535
- goos: windows
3636
goarch: arm64
3737
docker_manifests:
38-
- name_template: otel/otelcol:{{ .Tag }}
38+
- name_template: otel/opentelemetry-collector:{{ .Tag }}
3939
image_templates:
40-
- otel/otelcol:{{ .Tag }}-amd64
40+
- otel/opentelemetry-collector:{{ .Tag }}-amd64
4141
dockers:
4242
- image_templates:
4343
- "otel/otelcol:{{ .Tag }}-amd64"
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONTAINER_BASE_NAME=otel/opentelemetry-collector

scripts/generate-goreleaser-config.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ for template in $templates
2727
do
2828
for distribution in $(echo $distributions | tr "," "\n")
2929
do
30-
sed "s/{distribution}/${distribution}/gi" "${TEMPLATES_DIR}/${template}.template.yaml" > "${GEN_YAML_DIR}/${distribution}-${template}.yaml"
30+
export CONTAINER_BASE_NAME="otel/{distribution}"
31+
DIST_CONF="${REPO_DIR}/distributions/${distribution}/distribution.conf"
32+
33+
if [ -f "${DIST_CONF}" ]; then
34+
set -o allexport
35+
source "${DIST_CONF}"
36+
set +o allexport
37+
fi
38+
39+
sed "s/{distribution}/${distribution}/gi" "${TEMPLATES_DIR}/${template}.template.yaml" | envsubst > "${GEN_YAML_DIR}/${distribution}-${template}.yaml"
3140
if [ $? != 0 ]; then
3241
echo "❌ ERROR: failed to generate '${template}' YAML snippets for '${distribution}'."
3342
exit 1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
docker_manifests:
2-
- name_template: otel/{distribution}:{{ .Tag }}
2+
- name_template: ${CONTAINER_BASE_NAME}:{{ .Tag }}
33
image_templates:
4-
- otel/{distribution}:{{ .Tag }}-amd64
4+
- ${CONTAINER_BASE_NAME}:{{ .Tag }}-amd64

0 commit comments

Comments
 (0)