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

build(docker): always publish full and minor version tags for dev images #306

Merged
merged 1 commit into from
Oct 18, 2023
Merged
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
37 changes: 27 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
DanStough marked this conversation as resolved.
Show resolved Hide resolved
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 }}
Expand All @@ -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 }}
Expand All @@ -228,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)
Expand Down Expand Up @@ -275,7 +282,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 }}
Expand All @@ -295,8 +305,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 }}
Expand All @@ -316,8 +328,11 @@ 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 }})
Expand All @@ -335,6 +350,8 @@ jobs:
image: hashicorppreview/consul:1.16-dev
- version: v1.17.0-dev
image: hashicorppreview/consul:1.17-dev
- version: v1.18.0-dev
image: hashicorppreview/consul:1.18-dev
dataplane:
- image_suffix: ""
docker_target: "release-default"
Expand Down
Loading