Skip to content

Commit d633b3e

Browse files
xinredhatRoming22
authored andcommitted
build and scan e2e-test-runner image
1 parent 4e69d7c commit d633b3e

File tree

3 files changed

+75
-7
lines changed

3 files changed

+75
-7
lines changed

.github/workflows/build-push-images.yaml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ jobs:
3434
- '.github/workflows/build-push-images.yaml'
3535
- 'operator/images/cluster-setup/**'
3636
- 'shared/**'
37-
quay-upload:
38-
- '.github/workflows/build-push-images.yaml'
39-
- 'ci/images/quay-upload/**'
40-
update-pipeline-service:
41-
- '.github/workflows/build-push-images.yaml'
42-
- 'operator/images/update-pipeline-service/**'
43-
- 'shared/**'
4437
dependencies-update:
4538
- '.github/workflows/build-push-images.yaml'
4639
- 'developer/images/dependencies/**'
@@ -49,10 +42,21 @@ jobs:
4942
- '.github/workflows/build-push-images.yaml'
5043
- 'developer/images/devenv/**'
5144
- 'shared/**'
45+
e2e-test-runner:
46+
- '.github/workflows/build-push-images.yaml'
47+
- 'ci/images/e2e-test-runner/**'
48+
- 'shared/**'
49+
quay-upload:
50+
- '.github/workflows/build-push-images.yaml'
51+
- 'ci/images/quay-upload/**'
5252
static-checks:
5353
- '.github/workflows/build-push-images.yaml'
5454
- 'ci/images/static-checks/**'
5555
- 'shared/**'
56+
update-pipeline-service:
57+
- '.github/workflows/build-push-images.yaml'
58+
- 'operator/images/update-pipeline-service/**'
59+
- 'shared/**'
5660
vulnerability:
5761
- '.github/workflows/build-push-images.yaml'
5862
- 'ci/images/vulnerability-scan/**'
@@ -309,6 +313,42 @@ jobs:
309313
run: |
310314
./ci/images/quay-upload/image-upload.sh --debug
311315
316+
# Build and push e2e-test-runner image, tagged with latest and the commit SHA.
317+
- name: Build e2e-test-runner Image
318+
id: build-image-e2e-test-runner
319+
if: steps.filter.outputs.e2e-test-runner == 'true'
320+
uses: redhat-actions/buildah-build@v2
321+
with:
322+
image: e2e-test-runner
323+
context: .
324+
tags: latest ${{ steps.vars.outputs.sha_short }} ${{ github.ref_name }}
325+
containerfiles: |
326+
./ci/images/e2e-test-runner/Dockerfile
327+
- name: Push to quay.io
328+
id: push-to-quay-e2e-test-runner
329+
if: steps.filter.outputs.e2e-test-runner == 'true'
330+
uses: redhat-actions/push-to-registry@v2
331+
with:
332+
image: ${{ steps.build-image-e2e-test-runner.outputs.image }}
333+
tags: ${{ steps.build-image-e2e-test-runner.outputs.tags }} ${{ github.ref_name }}
334+
registry: quay.io/redhat-pipeline-service
335+
username: ${{ secrets.QUAY_USERNAME }}
336+
password: ${{ secrets.QUAY_TOKEN }}
337+
- name: Print image url
338+
if: steps.filter.outputs.e2e-test-runner == 'true'
339+
run: |
340+
echo "Image pushed to ${{ steps.push-to-quay-e2e-test-runner.outputs.registry-paths }}"
341+
- name: Tag latest commit ID to quay.io
342+
id: tag-commit-quay-e2e-test-runner
343+
if: steps.filter.outputs.e2e-test-runner != 'true'
344+
env:
345+
image: e2e-test-runner
346+
registry: quay.io/redhat-pipeline-service
347+
username: ${{ secrets.QUAY_USERNAME }}
348+
password: ${{ secrets.QUAY_TOKEN }}
349+
run: |
350+
./ci/images/quay-upload/image-upload.sh --debug
351+
312352
# Build and push static-checks image, tagged with latest and the commit SHA.
313353
- name: Build static-checks Image
314354
id: build-image-static-checks

.github/workflows/individual-image-scanner-quay.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ci-runner-output: ${{ steps.ci-runner-scan.outputs.VULNERABILITIES_EXIST }}
2727
cluster-setup-output: ${{ steps.cluster-setup-scan.outputs.VULNERABILITIES_EXIST }}
2828
dependencies-update-output: ${{ steps.dependencies-update-scan.outputs.VULNERABILITIES_EXIST }}
29+
e2e-test-runner-output: ${{ steps.e2e-test-runner-scan.outputs.VULNERABILITIES_EXIST }}
2930
devenv-output: ${{ steps.devenv-scan.outputs.VULNERABILITIES_EXIST }}
3031
quay-upload-output: ${{ steps.quay-upload-scan.outputs.VULNERABILITIES_EXIST }}
3132
static-checks-output: ${{ steps.static-checks-scan.outputs.VULNERABILITIES_EXIST }}
@@ -54,6 +55,9 @@ jobs:
5455
devenv:
5556
- 'developer/images/devenv/**'
5657
- 'shared/**'
58+
e2e-test-runner:
59+
- 'ci/images/e2e-test-runner/**'
60+
- 'shared/**'
5761
quay-upload:
5862
- 'ci/quay-upload/**'
5963
static-checks:
@@ -153,6 +157,16 @@ jobs:
153157
env:
154158
IMAGE_NAME: vulnerability-scan
155159

160+
- name: e2e-test-runner scan
161+
continue-on-error: true
162+
id: e2e-test-runner-scan
163+
if: steps.filter.outputs.e2e-test-runner == 'true'
164+
run: |
165+
./ci/images/vulnerability-scan/scan-image.sh | tee /tmp/clair-scan.log
166+
echo "VULNERABILITIES_EXIST=$(tail -1 /tmp/clair-scan.log)" >> $GITHUB_OUTPUT
167+
env:
168+
IMAGE_NAME: e2e-test-runner
169+
156170
check-results:
157171
runs-on: ubuntu-latest
158172
needs: scans
@@ -274,3 +288,16 @@ jobs:
274288
else
275289
echo "No vulnerabilities found"
276290
fi
291+
292+
- name: Check e2e-test-runner results
293+
id: check-e2e-test-runner-results
294+
if: always()
295+
run: |
296+
res=${{ needs.scans.outputs.e2e-test-runner-output }}
297+
res=${res:=0}
298+
if [[ $res != 0 ]]; then
299+
echo "Vulnerabilities found with e2e-test-runner image. Please check scans job for more details."
300+
exit 1
301+
else
302+
echo "No vulnerabilities found"
303+
fi

.github/workflows/periodic-scanner-quay.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
"cluster-setup"
2929
"dependencies-update"
3030
"devenv"
31+
"e2e-test-runner"
3132
"quay-upload"
3233
"static-checks"
3334
"update-pipeline-service"

0 commit comments

Comments
 (0)