diff options
author | David Spickett <david.spickett@linaro.org> | 2020-04-21 16:06:08 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2020-04-22 13:53:59 +0100 |
commit | 2382c087b5f0d51a4556c8c62f4723ab5a0ab7c9 (patch) | |
tree | 70c781a3087d886dc08a92767b6754991858fd7b /start-container-docker.sh | |
parent | 7dac1306e35858ef6485a0abf6222f6e13a28ee0 (diff) |
Various shellcheck warning fixes
First round of low hanging fruit
from the files with the fewest
warnings.
Change-Id: I60ad57b5bfb2f0be9bb6506252c820f44d055200
Diffstat (limited to 'start-container-docker.sh')
-rwxr-xr-x | start-container-docker.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/start-container-docker.sh b/start-container-docker.sh index 3892f999..ff98d563 100755 --- a/start-container-docker.sh +++ b/start-container-docker.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -o pipefail -. $(dirname $0)/jenkins-helpers.sh +. "$(dirname $0)"/jenkins-helpers.sh # Start a local docker instance with the requested arch and distro @@ -26,8 +26,8 @@ usage() { echo " prefix: prefix to prepend to output variables and functions" echo " session-host: hostname where the container will run, defaults to localhost" echo " useful if the name resolution does not work correctly" - echo " session-name: session, in case the default '$BUILD_NUMBER-$JOB_NAME' is not suitable" - echo " ssh_info: set $ssh_host and $ssh_port env variables in the container" + echo " session-name: session, in case the default '\$BUILD_NUMBER-\$JOB_NAME' is not suitable" + echo " ssh_info: set \$ssh_host and \$ssh_port env variables in the container" echo " task: type of container (build, test or bench, default=build)" echo " user: remote user to use in the container." echo " weight: container weight, reserves resources. Default=1" @@ -196,6 +196,7 @@ fi if [ x"$session_name" = x ]; then # Set the default session_name, using BUILD_NUMBER and JOB_NAME, # as set by Jenkins. + # shellcheck disable=SC2153 if [ "x$BUILD_NUMBER" != "x" -a "x$JOB_NAME" != "x" ]; then session_name="$BUILD_NUMBER-$JOB_NAME" else @@ -325,6 +326,7 @@ fi # Remove the docker instance we have just created in case something # goes wrong. CONTAINER_CLEANUP="$DOCKER rm -fv ${session_id}" +# shellcheck disable=SC2064 trap "exec 1>&3 2>&4 ; ${CONTAINER_CLEANUP}" EXIT if [ x"$newuser" != x"" ]; then |