Skip to content

Commit 8176245

Browse files
committed
Fail on failing CVE scan
1 parent b2e2e44 commit 8176245

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ jobs:
204204
path: ./tmp
205205
- run: docker load --input ./tmp/image*.tar
206206
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
207-
- run: make scan-vulnerability
207+
- run: make ci-scan-vulnerability
208208
scan-vulnerability-http:
209209
name: Scan nginx ${{ matrix.nginx }} for vulnerabilities
210210
needs:
@@ -233,7 +233,7 @@ jobs:
233233
shell: bash
234234
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
235235
shell: bash
236-
- run: make scan-vulnerability
236+
- run: make ci-scan-vulnerability
237237
shell: bash
238238
scan-vulnerability-prometheus-exporter-file:
239239
name: Scan HTTP prometheus-exporter-file for vulnerabilities
@@ -258,7 +258,7 @@ jobs:
258258
path: ./tmp
259259
- run: docker load --input ./tmp/image*.tar
260260
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
261-
- run: make scan-vulnerability
261+
- run: make ci-scan-vulnerability
262262
test-php:
263263
name: Functionaly test PHP ${{ matrix.php }} for ${{ matrix.type }} on Alpine ${{ matrix.alpine }}
264264
needs:

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ scan-vulnerability:
110110
mkdir -p ./tmp/clair/usabillabv
111111
cat ./tmp/build-*.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./tmp/clair/%.json" -l ./tmp/clair/clair.log % || echo "% is vulnerable"'
112112
docker-compose -f test/security/docker-compose.yml -p clair-ci down
113+
114+
ci-scan-vulnerability:
115+
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
116+
RETRIES=0 && while ! wget -T 10 -q -O /dev/null http://localhost:6060/v1/namespaces ; do sleep 1 ; echo -n "." ; if [ $${RETRIES} -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; RETRIES=$$(($${RETRIES}+1)) ; done
117+
mkdir -p ./tmp/clair/usabillabv
118+
cat ./tmp/build-*.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./tmp/clair/%.json" -l ./tmp/clair/clair.log %'

0 commit comments

Comments
 (0)