From 0e9342fab63ea4f4c913471b7ae28e8f52c1c7a9 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 23 Oct 2023 07:41:52 -0700 Subject: [PATCH] only build the production environment when the previous steps all executed successfully --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index ca09ef4..9553ec7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,6 +62,7 @@ pipeline { } stage('Build production deliverable') { steps { + when { equals expected: 'SUCCESS', actual: buildResult } catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { sh ''' #!/usr/local/bin/bash ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"