From d74b53fbc254aae70fd9a6e9c644986dcc6b3b46 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 6 May 2020 16:46:28 +0100 Subject: jenkins-helpers.sh: Add log URL when running a step Change-Id: I5e21cc78e7138054b4df4f16f2dd36a7d9e4ba62 --- jenkins-helpers.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index e77b07e0..21417d96 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -1251,12 +1251,20 @@ run_step () esac if ! $skip; then - run_step_artifacts=$run_step_top_artifacts/$(printf "%02d" $run_step_count)-$pretty_step + local full_step_name + full_step_name=$(printf "%02d" $run_step_count)-$pretty_step + # This is used when accessing the workspace + run_step_artifacts=$run_step_top_artifacts/$full_step_name + local log_url + if [ -v BUILD_URL ]; then + # Link to jenkins, valid once the job has finished + log_url="(${BUILD_URL}artifact/artifacts/$full_step_name/console.log)" + fi rm -rf "$run_step_artifacts" mkdir -p "$run_step_artifacts" - echo "RUNNING ${step[*]}; see tail -f $run_step_artifacts/console.log" + echo "RUNNING ${step[*]}; see tail -f $run_step_artifacts/console.log" $log_url run_step_status=0 eval "if $run_step_verbose; then set -x; else set +x; fi; ${step[*]}" 2>&1 | ts -s "%T" | tee -a $run_step_top_artifacts/console.log > $run_step_artifacts/console.log & wait $! || run_step_status=$? -- cgit v1.2.3