Skip to content

Commit

Permalink
Push tag with Alpine version (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Jan 18, 2024
1 parent 6c128ec commit 4132c8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ jobs:
run: make docker-build BUILD_OPTS="${BUILD_OPTS}"
- name: Get image tag
id: full-tag
run: make show-image-full-tag
run: |
make show-image-full-tag
make show-image-full-tag-with-alpine-version
- name: Build integrations-builder
if: env.ENABLE_BUILD_INTEGRATIONS_BUILDER == 1
Expand Down Expand Up @@ -124,6 +126,11 @@ jobs:
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag }}
docker push \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag }}
docker tag \
${{ steps.tag.outputs.tag }} \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag_with_alpine_version }}
docker push \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag_with_alpine_version }}
docker tag \
${{ steps.tag.outputs.tag }} \
ghcr.io/${{ github.repository_owner }}/${{ steps.tag.outputs.tag }}
Expand All @@ -138,6 +145,11 @@ jobs:
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag }}-integrations-builder
docker push \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag }}-integrations-builder
docker tag \
${{ steps.tag.outputs.tag }}-integrations-builder \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag_with_alpine_version }}-integrations-builder
docker push \
ghcr.io/${{ github.repository_owner }}/${{ steps.full-tag.outputs.full_tag_with_alpine_version }}-integrations-builder
- name: Notify failure
uses: seqsense/sq-actions/notify-branch-build@main
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ show-image-tag:

.PHONY: show-image-full-tag
show-image-full-tag:
@echo "full_tag=$(NAME):$$(docker run --rm --entrypoint /opt/datadog-agent/bin/agent/agent $(NAME):$(TAG) version -n | cut -f2 -d" ")$(TAG_SUFFIX)" >> ${GITHUB_OUTPUT}
@echo "full_tag=$(NAME):$$(docker run --rm --entrypoint /opt/datadog-agent/bin/agent/agent $(NAME):$(TAG) version -n | cut -f2 -d" ")$(TAG_SUFFIX)" | tee -a ${GITHUB_OUTPUT}

.PHONY: show-image-full-tag-with-alpine-version
show-image-full-tag-with-alpine-version:
@echo "full_tag_with_alpine_version=$(NAME):$$(docker run --rm --entrypoint /opt/datadog-agent/bin/agent/agent $(NAME):$(TAG) version -n | cut -f2 -d" ")$(TAG_SUFFIX)$$(docker run --rm --entrypoint sh $(NAME):$(TAG) -c '. /etc/os-release; echo $${VERSION_ID} | head -n1 | cut -d"." -f1-2')" | tee -a ${GITHUB_OUTPUT}

0 comments on commit 4132c8a

Please sign in to comment.