From ae0c736ea753b74796f71ab94c649f8fbfa8eb28 Mon Sep 17 00:00:00 2001 From: willemjan Date: Fri, 28 Aug 2026 14:24:48 +0200 Subject: [PATCH] updated scan stage --- Jenkinsfile | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c80f53f..5589d87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,12 +28,6 @@ pipeline { } stage('Test') { - agent { - docker { - image 'python:3.12-slim' - reuseNode true - } - } steps { sh ''' python -m venv .venv @@ -64,14 +58,17 @@ pipeline { } stage('Scan') { - agent { - docker { - image 'aquasec:trivy' - reuseNode true - } - } steps { - sh 'trivy image --exit-code 0 --severity HIGH,CRITICAL $IMAGE:$TAG' + sh ''' + docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v trivy-cache:/root/.cache/trivy \ + aquasec/trivy:latest image \ + --severity HIGH,CRITICAL \ + --ignore-unfixed \ + --exit-code 0 \ + $IMAGE:$TAG + ''' } } @@ -95,13 +92,13 @@ pipeline { ''' } } + post { + always { sh 'oc logout || true' } + success { + sh 'echo "Deployed: $(oc get route glucose-dashboard -o jsonpath={.spec.host})" || true' + } + } } } - - post { - always { sh 'oc logout || true' } - success { - sh 'echo "Deployed: $(oc get route glucose-dashboard -o jsonpath={.spec.host})" || true' - } - } + } \ No newline at end of file