Skip to content

Commit b0a36f4

Browse files
authored
ensure wafv5 base images are created (nginx#5771)
1 parent 478fd04 commit b0a36f4

File tree

4 files changed

+46
-14
lines changed

4 files changed

+46
-14
lines changed

.github/workflows/build-base-images.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ jobs:
196196
- image: alpine-plus-nap-fips
197197
platforms: "linux/amd64"
198198
nap_modules: waf
199+
- image: alpine-plus-nap-v5-fips
200+
target: goreleaser
201+
platforms: "linux/amd64"
202+
nap_modules: waf
203+
- image: debian-plus-nap-v5
204+
target: goreleaser
205+
platforms: "linux/amd64"
206+
nap_modules: waf
207+
- image: ubi-9-plus-nap-v5
208+
target: goreleaser
209+
platforms: "linux/amd64"
210+
nap_modules: waf
211+
- image: ubi-8-plus-nap-v5
212+
target: goreleaser
213+
platforms: "linux/amd64"
214+
nap_modules: waf
199215
steps:
200216
- name: Checkout Repository
201217
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

.github/workflows/build-oss.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ jobs:
121121
- name: Check if base images exist
122122
id: base_exists
123123
run: |
124-
if docker manifest inspect gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}; then
125-
echo "exists=0" >> $GITHUB_OUTPUT
126-
else
127-
echo "exists=1" >> $GITHUB_OUTPUT
124+
base_image="gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}"
125+
echo "image=${base_image}" >> $GITHUB_OUTPUT
126+
if docker manifest inspect ${base_image}; then
127+
echo "exists=true" >> $GITHUB_OUTPUT
128128
fi
129129
if: ${{ ! inputs.forked-workflow }}
130130

@@ -136,14 +136,14 @@ jobs:
136136
cache-from: type=gha,scope=${{ inputs.image }}
137137
cache-to: type=gha,scope=${{ inputs.image }},mode=max
138138
target: common
139-
tags: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}
139+
tags: ${{ steps.base_exists.outputs.image }}
140140
platforms: ${{ inputs.platforms }}
141141
pull: true
142142
push: true
143143
build-args: |
144144
BUILD_OS=${{ inputs.image }}
145145
IC_VERSION=${{ inputs.tag }}
146-
if: ${{ ! inputs.forked-workflow && steps.base_exists.outputs.exists != 0 }}
146+
if: ${{ ! inputs.forked-workflow && steps.base_exists.outputs.exists != 'true' }}
147147

148148
- name: Get short tag
149149
id: tag
@@ -206,7 +206,7 @@ jobs:
206206
provenance: false
207207
build-args: |
208208
BUILD_OS=${{ inputs.image }}
209-
${{ ! 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) || '' }}
209+
${{ ! inputs.forked-workflow && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image) || '' }}
210210
IC_VERSION=${{ (github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/release-')) && 'CI' || steps.meta.outputs.version }}
211211
212212
- name: Certify Images

.github/workflows/build-plus.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ jobs:
153153
- name: Check if base images exist
154154
id: base_exists
155155
run: |
156-
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
157-
echo "exists=0" >> $GITHUB_OUTPUT
158-
else
159-
echo "exists=1" >> $GITHUB_OUTPUT
156+
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' || '' }}"
157+
echo "image=${base_image}" >> $GITHUB_OUTPUT
158+
if docker manifest inspect ${base_image}; then
159+
echo "exists=true" >> $GITHUB_OUTPUT
160160
fi
161161
if: ${{ ! inputs.forked-workflow }}
162162

@@ -168,7 +168,7 @@ jobs:
168168
cache-from: type=gha,scope=${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
169169
cache-to: type=gha,scope=${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }},mode=max
170170
target: common
171-
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) || '' }}
171+
tags: ${{ steps.base_exists.outputs.image }}
172172
platforms: ${{ inputs.platforms }}
173173
pull: true
174174
push: true
@@ -180,7 +180,7 @@ jobs:
180180
"nginx-repo.crt=${{ inputs.nap_modules != '' && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
181181
"nginx-repo.key=${{ inputs.nap_modules != '' && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
182182
${{ inputs.nap_modules != '' && contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
183-
if: ${{ ! inputs.forked-workflow && steps.base_exists.outputs.exists != 0 }}
183+
if: ${{ ! inputs.forked-workflow && steps.base_exists.outputs.exists != 'true' }}
184184

185185
- name: Build Plus Docker image
186186
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
@@ -202,7 +202,7 @@ jobs:
202202
provenance: false
203203
build-args: |
204204
BUILD_OS=${{ inputs.image }}
205-
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) || '' }}
205+
${{ ! inputs.forked-workflow && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image) || '' }}
206206
IC_VERSION=${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && steps.meta.outputs.version || 'CI' }}
207207
${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.modules) || '' }}
208208
${{ contains(inputs.image, 'v5') && 'WAF_VERSION=v5' || '' }}

.github/workflows/cache-update.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,22 @@ jobs:
168168
target: goreleaser
169169
platforms: "linux/amd64"
170170
nap_modules: waf
171+
- image: alpine-plus-nap-v5-fips
172+
target: goreleaser
173+
platforms: "linux/amd64"
174+
nap_modules: waf
175+
- image: debian-plus-nap-v5
176+
target: goreleaser
177+
platforms: "linux/amd64"
178+
nap_modules: waf
179+
- image: ubi-9-plus-nap-v5
180+
target: goreleaser
181+
platforms: "linux/amd64"
182+
nap_modules: waf
183+
- image: ubi-8-plus-nap-v5
184+
target: goreleaser
185+
platforms: "linux/amd64"
186+
nap_modules: waf
171187
uses: ./.github/workflows/build-plus.yml
172188
with:
173189
platforms: ${{ matrix.platforms }}

0 commit comments

Comments
 (0)