summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-05-23 14:40:55 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-05-25 09:34:37 +0000
commitd9d5b723c4d5dbc67813dba9b5498a064c852621 (patch)
tree3dfabda097a724cf0fb8f1cdcbd175c602edb2c5
parent2ea082c1cab77c5ffcd152c7fde90ab12a4f6ec1 (diff)
tcwg-benchmark.sh: Use parameters from environment
It is a pain to sync parameters between tcwg-benchmark.sh and .yaml file. Change-Id: Ifcae66a9acb6fae1805305e15a3168b6462d9094
-rwxr-xr-xtcwg-benchmark.sh46
1 files changed, 20 insertions, 26 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh
index cd26529d..728f0afc 100755
--- a/tcwg-benchmark.sh
+++ b/tcwg-benchmark.sh
@@ -2,34 +2,27 @@
# Clean: shellcheck -e 2001 ./tcwg-benchmark.sh
-set -exu
+set -ex
-usage ()
-{
- echo "ERROR: Unsupported options:" "$@"
- exit 1
-}
+# Make shellcheck happy and workaround Jenkins not defining variables
+# for empty arguments.
+toolchain_url="$toolchain_url"
+bench_list="$bench_list"
+cflags="$cflags"
+extension="$extension"
+testmode="$testmode"
+iterations="$iterations"
+run_profile="$run_profile"
+sysroot="$sysroot"
+fileserver="$fileserver"
+forceinstall="$forceinstall"
+BUILD_NUMBER="$BUILD_NUMBER"
+NODE_NAME="$NODE_NAME"
+WORKSPACE="$WORKSPACE"
-while [ $# -ge 1 ]; do
- case "$1" in
- --toolchain_url) toolchain_url="$2" ;;
- --bench_list) bench_list="$2" ;;
- --cflags) cflags="$2" ;;
- --extension) extension="$2" ;;
- --testmode) testmode="$2" ;;
- --iterations) iterations="$2" ;;
- --run_profile) run_profile="$2" ;;
- --sysroot) sysroot="$2" ;;
- --fileserver) fileserver="$2" ;;
- --forceinstall) forceinstall="$2" ;;
- --label) label="$2"; label="$label" ;;
- --build_number) BUILD_NUMBER="$2" ;;
- --node_name) NODE_NAME="$2" ;;
- --workspace) WORKSPACE="$2" ;;
- *) usage "$@" ;;
- esac
- shift 2
-done
+# Jenkins doesn't define variables when parameter value is empty (like cflags),
+# so enable "set -u" only after above binding of variables.
+set -u
./start-container-docker.sh --arch amd64 --node "$NODE_NAME" --distro trusty --task build --prefix build_ > build-container.sh
build_container_host=
@@ -52,6 +45,7 @@ case "$toolchain_url" in
;;
"http://"*".tar.xz"|"https://"*".tar.xz")
wget_wildcard_url "$toolchain_url" --no-check-certificate
+ # shellcheck disable=SC2046
tarball="$(ls $(basename "$toolchain_url"))"
tar xf "${tarball}"
toolchaindir=$(echo "${tarball}" | sed 's/.tar.xz//')