updated scan stage
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit

This commit is contained in:
2026-08-28 14:24:48 +02:00
parent 1f2b0d917a
commit ae0c736ea7
Vendored
+13 -16
View File
@@ -28,12 +28,6 @@ pipeline {
} }
stage('Test') { stage('Test') {
agent {
docker {
image 'python:3.12-slim'
reuseNode true
}
}
steps { steps {
sh ''' sh '''
python -m venv .venv python -m venv .venv
@@ -64,14 +58,17 @@ pipeline {
} }
stage('Scan') { stage('Scan') {
agent {
docker {
image 'aquasec:trivy'
reuseNode true
}
}
steps { 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 { post {
always { sh 'oc logout || true' } always { sh 'oc logout || true' }
success { success {
sh 'echo "Deployed: $(oc get route glucose-dashboard -o jsonpath={.spec.host})" || true' sh 'echo "Deployed: $(oc get route glucose-dashboard -o jsonpath={.spec.host})" || true'
} }
} }
}
}
} }