diff options
| -rw-r--r-- | .gitlab-ci.yml | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b9a51e..6da4733 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,13 @@ stages: - tag - release +include: + - template: Container-Scanning.gitlab-ci.yml + +container_scanning: + variables: + CI_APPLICATION_REPOSITORY: $CI_REGISTRY_IMAGE/tmp + build commit: image: docker:stable stage: build @@ -38,28 +45,6 @@ code_quality: reports: codequality: gl-code-quality-report.json -container_scanning: - image: docker:stable - stage: test - allow_failure: true - script: - - docker run -d --name db arminc/clair-db:latest - - docker run -p 6060:6060 --link db:postgres -d --name clair --restart on-failure arminc/clair-local-scan:v2.0.1 - - apk add -U wget ca-certificates - - docker pull $TMP_IMAGE - - wget https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 - - mv clair-scanner_linux_amd64 clair-scanner - - chmod +x clair-scanner - - touch clair-whitelist.yml - - while( ! wget -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; done - - retries=0 - - echo "Waiting for clair daemon to start" - - while( ! wget -T 10 -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; echo -n "." ; if [ $retries -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; retries=$(($retries+1)) ; done - - ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-container-scanning-report.json -l clair.log -w clair-whitelist.yml $TMP_IMAGE || true - artifacts: - reports: - container_scanning: gl-container-scanning-report.json - .QA: image: docker:stable stage: test |
