diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-27 10:13:48 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-28 05:32:23 +0000 |
commit | 69011f21ffa6cd45c09fd143bce287ffe8834ca0 (patch) | |
tree | 47fcfa7023bc47fb433a918d39a3f87d0135916b | |
parent | b6fd5948377c67ca1eb9fdf66a1847bdee9d02e6 (diff) |
start-container-docker: Fix handling of architecture without host/node/label
Fix docker image architecture detection when no host/node/label option is
given -- e.g., when called via docker-run.sh.
Change-Id: I1bf08668376c07e5380816a0681aa67f7a856f71
-rw-r--r-- | jenkins-helpers.sh | 2 | ||||
-rwxr-xr-x | start-container-docker.sh | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index a045febd..a9b815c3 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -124,7 +124,7 @@ print_arch_for_host () local arch case "$host" in - "localhost"*) + "localhost") arch=$(uname -m) case "$arch" in "aarch64") arch="arm64" ;; diff --git a/start-container-docker.sh b/start-container-docker.sh index fc3b1f05..ad90942f 100755 --- a/start-container-docker.sh +++ b/start-container-docker.sh @@ -163,13 +163,16 @@ if [ x"$session_host" = x"" ]; then # Get first FQDN. This name needs to have .tcwglab suffix for VPN'ed # machines and entries in .ssh/config for external machines. session_host=$(hostname -A | cut -d" " -f 1) + arch_host="localhost" +else + arch_host="$session_host" fi if [ x"${container_arch}" = x"default" ]; then if [ x"$label" != x"" ]; then container_arch=$(print_arch_for_label "$label") else - container_arch=$(print_arch_for_host "$session_host") + container_arch=$(print_arch_for_host "$arch_host") fi elif [ x"$label" != x"" ]; then echo "--arch conflicts with --label" |