From bf1fefd1bce1c488021c07d49c1420ab738ad3b5 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Sun, 22 Oct 2023 14:05:51 -0700 Subject: [PATCH] still worknig on env file, and adding logic to not build if the tests fail --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 456771e..15a1c87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { sh ''' #!/usr/local/bin/bash rbenv local 3.2.2 echo "# frozen_string_literal: true\n" > env.rb - echo "ENV[\\'APP_SESSION_SECRET\\'] ||= \\'$(ruby -rsecurerandom -e 'puts SecureRandom.base64(64)')\\'" >> .env.rb + echo "ENV['APP_SESSION_SECRET'] ||= '$(ruby -rsecurerandom -e 'puts SecureRandom.base64(64)')'" >> .env.rb echo "ENV[\\\'DB_NAME\\\'] ||= \\\'${DB_NAME}\\\'" >> .env.rb ''' } @@ -53,6 +53,9 @@ pipeline { } stage('Build production deliverable') { steps { + when { + expression { buildResult != 'FAILURE' } + } catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { sh ''' #!/usr/local/bin/bash ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"