prod-artifact-when-good #34

Merged
bucky merged 9 commits from prod-artifact-when-good into master 2023-10-23 15:54:28 -07:00
Showing only changes of commit 7c0f6eb603 - Show all commits
Vendored
+15 -1
View File
@@ -1,3 +1,5 @@
def buildArtifact = true
pipeline { pipeline {
agent { label 'ruby && freebsd' } agent { label 'ruby && freebsd' }
@@ -25,8 +27,16 @@ pipeline {
stage('Audit Dependencies') { stage('Audit Dependencies') {
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script {
try {
sh 'bundle exec ruby-audit check' sh 'bundle exec ruby-audit check'
sh 'bundle exec bundle-audit check >> audit.html' sh 'bundle exec bundle-audit check >> audit.html'
} catch (e) {
script {
buildArtifact = false
}
}
}
} }
} }
} }
@@ -61,7 +71,11 @@ pipeline {
} }
stage('Build production deliverable') { stage('Build production deliverable') {
steps { steps {
echo "BUILD RESULT: ${buildResult}" when {
expression {
buildArtifact
}
}
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh ''' #!/usr/local/bin/bash sh ''' #!/usr/local/bin/bash
ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz" ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"