Skip to content

Commit

Permalink
ensure wafv5 base images are created
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 committed Jun 18, 2024
1 parent 478fd04 commit b7c83ea
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ jobs:
- image: alpine-plus-nap-fips
platforms: "linux/amd64"
nap_modules: waf
- image: alpine-plus-nap-v5-fips
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: debian-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-9-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
steps:
- name: Checkout Repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ jobs:
- name: Check if base images exist
id: base_exists
run: |
if docker manifest inspect gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}; then
base_image="gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}"
echo "image=${base_image}"
if docker manifest inspect ${base_image}; then
echo "exists=0" >> $GITHUB_OUTPUT
else
echo "exists=1" >> $GITHUB_OUTPUT
Expand All @@ -136,7 +138,7 @@ jobs:
cache-from: type=gha,scope=${{ inputs.image }}
cache-to: type=gha,scope=${{ inputs.image }},mode=max
target: common
tags: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}
tags: ${{ steps.base_exists.outputs.image }}
platforms: ${{ inputs.platforms }}
pull: true
push: true
Expand Down Expand Up @@ -206,7 +208,7 @@ jobs:
provenance: false
build-args: |
BUILD_OS=${{ inputs.image }}
${{ ! inputs.forked-workflow && format('PREBUILT_BASE_IMG=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:{0}-{1}', inputs.base-image-md5, inputs.image) || '' }}
${{ ! inputs.forked-workflow && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image) || '' }}
IC_VERSION=${{ (github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/release-')) && 'CI' || steps.meta.outputs.version }}
- name: Certify Images
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-plus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ jobs:
- name: Check if base images exist
id: base_exists
run: |
if docker manifest inspect gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}; then
base_image="gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}${{ contains(inputs.image, 'v5') && '-v5' || '' }}"
echo "image=${base_image}"
if docker manifest inspect ${base_image}; then
echo "exists=0" >> $GITHUB_OUTPUT
else
echo "exists=1" >> $GITHUB_OUTPUT
Expand All @@ -168,7 +170,7 @@ jobs:
cache-from: type=gha,scope=${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
cache-to: type=gha,scope=${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }},mode=max
target: common
tags: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
tags: ${{ steps.base_exists.outputs.image }}
platforms: ${{ inputs.platforms }}
pull: true
push: true
Expand Down Expand Up @@ -202,7 +204,7 @@ jobs:
provenance: false
build-args: |
BUILD_OS=${{ inputs.image }}
PREBUILT_BASE_IMG=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
${{ ! inputs.forked-workflow && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image) || '' }}
IC_VERSION=${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && steps.meta.outputs.version || 'CI' }}
${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.modules) || '' }}
${{ contains(inputs.image, 'v5') && 'WAF_VERSION=v5' || '' }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/cache-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ jobs:
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: alpine-plus-nap-v5-fips
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: debian-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-9-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
uses: ./.github/workflows/build-plus.yml
with:
platforms: ${{ matrix.platforms }}
Expand Down

0 comments on commit b7c83ea

Please sign in to comment.