summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-04-23 11:10:08 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-04-28 13:13:46 +0000
commit6273fc478b9c95c4ae8d42c9021f9428b1d43811 (patch)
tree9564b82cc9e90dc4886835d30cbdea35453b1f53 /jenkins-helpers.sh
parent0ce72e970e6cbb6c39469b503cdf65510f4f99d8 (diff)
Shellcheck fixes round 3
Now using the version that's present in the bionic images. Meaning we have more warnings but can also set the minimum level to ignore a lot of them. Fix the check for whether shellcheck supports --severity. (we have pipefail on, but we expect shellcheck to fail in this case) Change-Id: I296b8554591b7d327c75393e3924184abc6512b7
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 4e0ad8ff..813a97f4 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -777,7 +777,7 @@ print_volume_mounts ()
prefix=$(echo $job | cut -d- -f 1)
fi
volume_id=$(print_docker_name "$prefix$suffix")
- mounts+=(ccache-$volume_id:$HOME/.ccache)
+ mounts+=(ccache-"$volume_id":"$HOME"/.ccache)
;;
esac
case "$job" in
@@ -913,6 +913,7 @@ EOF
num=2
;;
"@@")
+ # shellcheck disable=SC1090
source "$2"
echo "# Start of include $2" | manifest_out
cat "$2" | manifest_out
@@ -930,12 +931,13 @@ EOF
"^^")
if [ x"$2" = x"true" ]; then
# Check that we have a manifest to reproduce
- if [ x"$3" != x"%%" -o ! -f "$4" ]; then
+ if [ x"$3" != x"%%" ] || [ ! -f "$4" ]; then
echo "ERROR: '^^ true' must be followed by '%% <MANIFEST>'"
exit 1
fi
# Source the manifest for reproduction.
+ # shellcheck disable=SC1090
source "$4"
# Skip processing all following arguments.
@@ -1213,8 +1215,9 @@ run_step ()
run_step_count=$(($run_step_count+1))
- if [ x"$pretty_step" = x"$run_step_start_at" \
- -o x"$run_step_start_at" = x"" -a x"$run_step_prev_step" = x"" ]; then
+ if [ x"$pretty_step" = x"$run_step_start_at" ] || \
+ [ x"$run_step_start_at" = x"" ] && \
+ [ x"$run_step_prev_step" = x"" ]; then
run_step_active=true
fi
@@ -1265,7 +1268,7 @@ run_step ()
echo "SKIPPING ${step[*]}"
fi
- if [ x"$run_step_status" = x"0" -a x"$success_result" != x"x" ]; then
+ if [ x"$run_step_status" = x"0" ] && [ x"$success_result" != x"x" ]; then
cat >> $run_step_top_artifacts/results <<EOF
# ${step[@]}:
$success_result