From 25da9c8f4309a1d8ad60a78c7befc76857fb712e Mon Sep 17 00:00:00 2001 From: DanStough Date: Wed, 18 Oct 2023 14:01:49 -0400 Subject: [PATCH 1/2] build(docker): always publish full and minor version tags for dev images --- .github/workflows/build.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626301de..12838346 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,7 +187,10 @@ jobs: # This naming convention will be used ONLY for per-commit dev images - name: Set docker dev tag run: | - echo "dev_tag=${{ env.version }}" >> $GITHUB_ENV + echo "full_dev_tag=${{ env.version }}" + echo "full_dev_tag=${{ env.version }}" >> $GITHUB_ENV + echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" + echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" >> $GITHUB_ENV - name: Docker Build (Action) if: ${{ !matrix.fips }} @@ -207,8 +210,10 @@ jobs: docker.io/hashicorp/${{env.repo}}:${{env.version}} public.ecr.aws/hashicorp/${{env.repo}}:${{env.version}} dev_tags: | - docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }} - docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-${{ github.sha }} - name: Docker FIPS Build (Action) if: ${{ matrix.fips }} @@ -275,7 +280,10 @@ jobs: # This naming convention will be used ONLY for per-commit dev images - name: Set docker dev tag run: | - echo "dev_tag=${{ env.version }}" >> $GITHUB_ENV + echo "full_dev_tag=${{ env.version }}" + echo "full_dev_tag=${{ env.version }}" >> $GITHUB_ENV + echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" + echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" >> $GITHUB_ENV - name: Docker Build (Action) if: ${{ !matrix.fips }} @@ -295,8 +303,10 @@ jobs: docker.io/hashicorp/${{env.repo}}:${{env.version}}-ubi public.ecr.aws/hashicorp/${{env.repo}}:${{env.version}}-ubi dev_tags: | - docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-ubi - docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-ubi-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-ubi + docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-ubi-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-ubi + docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-ubi-${{ github.sha }} - name: Docker FIPS Build (Action) if: ${{ matrix.fips }} @@ -316,8 +326,10 @@ jobs: docker.io/hashicorp/${{env.repo}}-fips:${{env.version}}-ubi public.ecr.aws/hashicorp/${{env.repo}}-fips:${{env.version}}-ubi dev_tags: | - docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.dev_tag }}-ubi - docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.dev_tag }}-ubi-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.full_dev_tag }}-ubi + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.full_dev_tag }}-ubi-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.minor_dev_tag }}-ubi + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.minor_dev_tag }}-ubi-${{ github.sha }} integration-tests: name: Integration Tests (Consul ${{ matrix.server.version }} ${{ matrix.dataplane.docker_target }}) From e25302776433df5102a863a124116dfdf26da37d Mon Sep 17 00:00:00 2001 From: DanStough Date: Wed, 18 Oct 2023 14:21:44 -0400 Subject: [PATCH 2/2] build(docker): missed updating all docker tags --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12838346..29f7f3b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,8 +233,10 @@ jobs: docker.io/hashicorp/${{env.repo}}-fips:${{env.version}} public.ecr.aws/hashicorp/${{env.repo}}-fips:${{env.version}} dev_tags: | - docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.dev_tag }} - docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.dev_tag }}-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.full_dev_tag }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.full_dev_tag }}-${{ github.sha }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.minor_dev_tag }} + docker.io/hashicorppreview/${{ env.repo }}-fips:${{ env.minor_dev_tag }}-${{ github.sha }} build-docker-redhat: name: Docker ${{ matrix.fips }} UBI Image Build (for Red Hat Certified Container Registry)