diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-10-10 11:17:07 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-10-11 08:48:25 +0000 |
commit | b7ee25a420f3c28e650906a90a4cf7beac093ced (patch) | |
tree | 6c9df77ea1c771bb862a5c71ba5266329d204751 /jenkins-helpers.sh | |
parent | bc1af4540944982179cc2527995c5b84334b14ec (diff) |
jenkins-helpers.sh: Handle paths in run_step's arguments
When we pass ${rr[top_artifacts]}/results_id to "run_step ... benchmark"
we end up with artifacts directory for this step something like
artifacts/11-benchmark-.../home/$USER/<path>/.../results_id/ -- because
we include all arguments to the run_step in the pretty name of the step.
This patch makes $pretty_step name absorb arguments up to "--" in its
name, and also flattens any paths by changing "/" to "-".
Change-Id: I700818409337b9884284d785641edae4db419462
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r-- | jenkins-helpers.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index f48cd982..e02c492b 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -1183,7 +1183,17 @@ run_step () local pretty_step step=("$@") - pretty_step=$(echo "${step[@]}" | tr " " "-") + + pretty_step="$1" + shift + while [ $# -gt 0 ]; do + if [ x"$1" = x"--" ]; then + break + fi + pretty_step="$pretty_step-$1" + shift + done + pretty_step=$(echo "$pretty_step" | tr " /" "-") run_step_count=$(($run_step_count+1)) |