Commit a696a879 authored by DJOUNANG NANA Guy Rostan's avatar DJOUNANG NANA Guy Rostan Committed by Thomas Boni
Browse files

ci: Add jobs dir to store the results of the new entry cmd trivy for each job.

parent 7c9ed0e8
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -151,9 +151,7 @@ job_customs:
    - wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
    - tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
    - wget -O $TEMPLATE_NAME https://github.com/aquasecurity/trivy/raw/v${TRIVY_VERSION}/contrib/junit.tpl

    - mkdir ${OUTPUT_DIR}

    - mkdir -p ${OUTPUT_DIR}/jobs
  script:
    # We force database download once so we don't do much GitHub Api calls
    - ./trivy --cache-dir ${TRIVY_CACHE_DIR} image --download-db-only
@@ -169,6 +167,7 @@ job_customs:
    -   if [ ! -z ${IMAGE} ]; then
    -     NAME=$(basename ${IMAGE})
    -     ./trivy image --template "@${TEMPLATE_NAME}" --security-checks vuln --vuln-type ${TRIVY_VULN_TYPE} --offline-scan --cache-dir ${TRIVY_CACHE_DIR} -o ${OUTPUT_DIR}/${NAME}.${TRIVY_OUTPUT} ${IMAGE}
    -     ./trivy image --security-checks vuln --cache-dir ${TRIVY_CACHE_DIR} --offline-scan -f json -o ${OUTPUT_DIR}/JobsVul/${JOB}.json ${IMAGE}
    -     if [ ! -z ${TRIVY_EXIT_ON_SEVERITY} ]; then
    -       ./trivy image --template "@${TEMPLATE_NAME}" --security-checks vuln --vuln-type ${TRIVY_VULN_TYPE} --offline-scan --cache-dir ${TRIVY_CACHE_DIR} --exit-code 1 --severity ${TRIVY_SEVERITY} -o ${OUTPUT_DIR}/${NAME}-failed-${TRIVY_OUTPUT} ${IMAGE}
    -     fi