updated scan stage
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
This commit is contained in:
Vendored
+13
-16
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user