Skip to content

Commit dc378e3

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

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: Generate Alpine
2222
shell: bash
2323
run: |
24-
echo "::set-output name=versions::[\"3.12\", \"3.11\", \"3.10\"]"
24+
echo "::set-output name=versions::[\"3.13\", \"3.12\"]"
2525
supported-nginx-versions:
2626
name: Supported nginx versions
2727
runs-on: ubuntu-latest
@@ -43,7 +43,7 @@ jobs:
4343
name: Generate PHP
4444
shell: bash
4545
run: |
46-
echo "::set-output name=versions::[\"7.4\", \"7.3\", \"7.2\"]"
46+
echo "::set-output name=versions::[\"7.4\", \"7.3\"]"
4747
php-type-matrix:
4848
name: PHP Type Matrix
4949
runs-on: ubuntu-latest
@@ -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)