Bash script syntax improvements

This commit is contained in:
Roy Lenferink
2019-01-19 13:58:58 +01:00
parent 771baea30e
commit 6df3deb4bc
12 changed files with 128 additions and 128 deletions

View File

@@ -30,7 +30,7 @@ set -o xtrace
# is an incoming variable Jenkins provides us for this job's scratch
# space.
export HOME=${WORKSPACE} # Nothing should want Jenkins $HOME
export PATH=$PATH:/usr/local/go/bin
export PATH=${PATH}:/usr/local/go/bin
# Skip gcloud update checking
export CLOUDSDK_COMPONENT_MANAGER_DISABLE_UPDATE_CHECK=true

View File

@@ -28,7 +28,7 @@ set -o xtrace
# space.
export HOME=${WORKSPACE} # Nothing should want Jenkins $HOME
export GOPATH=${HOME}/_gopath
export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:$PATH
export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:${PATH}
# Install a few things needed by unit and /integration tests.
command -v etcd &>/dev/null || ./hack/install-etcd.sh

View File

@@ -139,9 +139,9 @@ function print_started() {
# will be available as started["metadata"][KEY.lower()].
echo " \"metadata\": {"
local sep="" # leading commas are easy to track
for env_var in $metadata_keys; do
for env_var in ${metadata_keys}; do
local var_upper="${env_var#BUILD_METADATA_}"
echo " $sep\"${var_upper,,}\": \"${!env_var}\""
echo " ${sep}\"${var_upper,,}\": \"${!env_var}\""
sep=","
done
echo " },"

View File

@@ -21,7 +21,7 @@ set -o xtrace
retry() {
for i in {1..5}; do
"$@" && return 0 || sleep $i
"$@" && return 0 || sleep "${i}"
done
"$@"
}

View File

@@ -28,7 +28,7 @@ set -o xtrace
# space.
export HOME=${WORKSPACE} # Nothing should want Jenkins $HOME
export GOPATH=${HOME}/_gopath
export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:$PATH
export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:${PATH}
# Install a few things needed by the verification tests.
command -v etcd &>/dev/null || ./hack/install-etcd.sh