diff --git a/vars/buildPodman.groovy b/vars/buildPodman.groovy index 0a3a539..09ace2c 100644 --- a/vars/buildPodman.groovy +++ b/vars/buildPodman.groovy @@ -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' } }