summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-05-06 16:46:28 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-05-15 14:19:51 +0100
commitd74b53fbc254aae70fd9a6e9c644986dcc6b3b46 (patch)
treee291c77a9c61b326ac8db25a7f964b8cbe2d36a8 /jenkins-helpers.sh
parentb3334e58e24ea4ade3088c620dec315e62042754 (diff)
jenkins-helpers.sh: Add log URL when running a step
Change-Id: I5e21cc78e7138054b4df4f16f2dd36a7d9e4ba62
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh12
1 files 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=$?