From 5cd296cb702a4c8fa6cdb5f6a87919e91f4200a0 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 23 Oct 2023 15:03:45 -0700 Subject: [PATCH] when is outside the steps --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 674125c..753fd86 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,12 +70,12 @@ pipeline { } } stage('Build production deliverable') { - steps { - when { - expression { - buildArtifact - } + when { + expression { + buildArtifact } + } + steps { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { sh ''' #!/usr/local/bin/bash ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"