From 4132c8a08503bb227087d5bdce73bfea0df20fef Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Thu, 18 Jan 2024 14:35:17 +0900 Subject: [PATCH] Push tag with Alpine version (#115) --- .github/workflows/build.yaml | 14 +++++++++++++- Makefile | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b4e2eed..bcb9a90 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 @@ -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 }} @@ -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 diff --git a/Makefile b/Makefile index 9a83d54..702f31c 100644 --- a/Makefile +++ b/Makefile @@ -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}