Skip to content

Commit

Permalink
Allow customization of properties (#19)
Browse files Browse the repository at this point in the history
Fixes #18

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling authored Sep 17, 2021
1 parent 4d29685 commit 87bccd2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ builds:
- goos: windows
goarch: arm64
docker_manifests:
- name_template: otel/otelcol:{{ .Tag }}
- name_template: otel/opentelemetry-collector:{{ .Tag }}
image_templates:
- otel/otelcol:{{ .Tag }}-amd64
- otel/opentelemetry-collector:{{ .Tag }}-amd64
dockers:
- image_templates:
- "otel/otelcol:{{ .Tag }}-amd64"
Expand Down
1 change: 1 addition & 0 deletions distributions/otelcol/distribution.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONTAINER_BASE_NAME=otel/opentelemetry-collector
11 changes: 10 additions & 1 deletion scripts/generate-goreleaser-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ for template in $templates
do
for distribution in $(echo $distributions | tr "," "\n")
do
sed "s/{distribution}/${distribution}/gi" "${TEMPLATES_DIR}/${template}.template.yaml" > "${GEN_YAML_DIR}/${distribution}-${template}.yaml"
export CONTAINER_BASE_NAME="otel/{distribution}"
DIST_CONF="${REPO_DIR}/distributions/${distribution}/distribution.conf"

if [ -f "${DIST_CONF}" ]; then
set -o allexport
source "${DIST_CONF}"
set +o allexport
fi

sed "s/{distribution}/${distribution}/gi" "${TEMPLATES_DIR}/${template}.template.yaml" | envsubst > "${GEN_YAML_DIR}/${distribution}-${template}.yaml"
if [ $? != 0 ]; then
echo "❌ ERROR: failed to generate '${template}' YAML snippets for '${distribution}'."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/goreleaser-templates/docker-manifests.template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker_manifests:
- name_template: otel/{distribution}:{{ .Tag }}
- name_template: ${CONTAINER_BASE_NAME}:{{ .Tag }}
image_templates:
- otel/{distribution}:{{ .Tag }}-amd64
- ${CONTAINER_BASE_NAME}:{{ .Tag }}-amd64

0 comments on commit 87bccd2

Please sign in to comment.