Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of properties #19

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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