chore: groovy formating

This commit is contained in:
Stefan Reimer 2022-02-11 18:13:04 +01:00
parent 2aa04e7ac5
commit cec5dcdece

View File

@ -1,61 +1,64 @@
// Common container builder by ZeroDownTime // Common container builder by ZeroDownTime
def call(Map config) { def call(Map config) {
pipeline { pipeline {
agent { node { label 'podman-aws-trivy' } } agent {
node {
label 'podman-aws-trivy'
}
}
stages { stages {
stage('Prepare'){ stage('Prepare') {
// get tags // get tags
steps { steps {
sh 'git fetch -q --tags ${GIT_URL} +refs/heads/${BRANCH_NAME}:refs/remotes/origin/${BRANCH_NAME}' sh 'git fetch -q --tags ${GIT_URL} +refs/heads/${BRANCH_NAME}:refs/remotes/origin/${BRANCH_NAME}'
} }
} }
// Build using rootless podman // Build using rootless podman
stage('Build'){ stage('Build') {
steps { steps {
sh 'make build' sh 'make build'
} }
} }
stage('Test'){ stage('Test') {
steps { steps {
sh 'make test' sh 'make test'
} }
} }
// Scan via trivy // Scan via trivy
stage('Scan'){ stage('Scan') {
environment { environment {
TRIVY_FORMAT = "template" TRIVY_FORMAT = "template"
TRIVY_OUTPUT = "reports/trivy.html" TRIVY_OUTPUT = "reports/trivy.html"
} }
steps { steps {
sh 'mkdir -p reports' sh 'mkdir -p reports'
sh 'make scan' sh 'make scan'
publishHTML target : [ publishHTML target: [
allowMissing: true, allowMissing: true,
alwaysLinkToLastBuild: true, alwaysLinkToLastBuild: true,
keepAll: true, keepAll: true,
reportDir: 'reports', reportDir: 'reports',
reportFiles: 'trivy.html', reportFiles: 'trivy.html',
reportName: 'TrivyScan', reportName: 'TrivyScan',
reportTitles: 'TrivyScan' reportTitles: 'TrivyScan'
] ]
// Scan again and fail on CRITICAL vulns // Scan again and fail on CRITICAL vulns
sh 'TRIVY_EXIT_CODE=1 TRIVY_SEVERITY=CRITICAL make scan' sh 'TRIVY_EXIT_CODE=1 TRIVY_SEVERITY=CRITICAL make scan'
} }
} }
// Push to ECR // Push to ECR
stage('Push'){ stage('Push') {
steps { steps {
sh 'make push' sh 'make push'
} }
} }
} }
} }
}
}