fix: do NOT push PRs to registry, other fixes

This commit is contained in:
Stefan Reimer 2022-12-21 12:27:30 +00:00
parent 50a6d670bf
commit fef496819e

View File

@ -12,7 +12,7 @@ def call(Map config=[:]) {
stage('Prepare') {
// get tags
steps {
sh 'git fetch -q --tags ${GIT_URL} +refs/heads/${BRANCH_NAME}:refs/remotes/origin/${BRANCH_NAME}'
sh 'git fetch -q --tags ${GIT_URL}'
}
}
@ -36,8 +36,7 @@ def call(Map config=[:]) {
TRIVY_OUTPUT = "reports/trivy.html"
}
steps {
sh 'mkdir -p reports'
sh 'make scan'
sh 'mkdir -p reports && make scan'
publishHTML target: [
allowMissing: true,
alwaysLinkToLastBuild: true,
@ -59,10 +58,11 @@ def call(Map config=[:]) {
}
}
// Push to ECR
// Push to container registry
stage('Push') {
steps {
sh 'make ecr-login push'
when { not { changeRequest() } }
sh 'make push'
}
}