diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2018-12-12 16:09:11 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2018-12-21 19:29:48 +0000 |
commit | e3a5895477c41254e7b0683c9f1313477ec84d3a (patch) | |
tree | e2867a4aff897c26409ab31fac5daf3af71bf5d5 /tcwg-benchmark.sh | |
parent | e6273bc94b7c13a2c3f3148c9947c22a1c4d0f58 (diff) |
tcwg-benchmark.sh: Do not create a remote build container when using ssh.
If toolchain_url is of ssh:// type, do not create a remote build
container, just use the ssh connexion as provided.
Change-Id: Id93be63fd61a0d99d433d7b6ebb65f0e1c2473f8
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-x | tcwg-benchmark.sh | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index 6128b125..058fe020 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -36,19 +36,52 @@ else docker_host_opt="--label $builder" fi -# Make sure to cleanup build container if something goes -# wrong when preparing the test environment -trap "cleanup_all_containers" EXIT -./start-container-docker.sh $docker_host_opt --distro "$build_container_tag" --task build --prefix build_ > build-container.sh +. jenkins-helpers.sh + +# If $toolchain_url is of ssh:// type, don't create a remote build +# container, just use the ssh command as provided. build_container_host= build_container_port= -. ./build-container.sh +case "$toolchain_url" in + "ssh://"*) + ccprefix="${toolchain_url##ssh://}" -. jenkins-helpers.sh + # Extract host:port: specification from ccprefix. + case ${ccprefix} in + *:*:*) + build=${ccprefix%:*} + build_container_host="$(echo $build | cut -d: -f 1)" + build_container_port="$(echo $build | cut -s -d: -f 2)" + ;; + esac + + if [ "x$build_container_host" = "x" ]; then + echo "ERROR: ssh:// toolchain_url lacks a host: $toolchain_url." + exit 1 + fi + if [ "x$build_container_port" = "x" ]; then + echo "ERROR: ssh:// toolchain_url lacks a port: $toolchain_url." + exit 1 + fi + + # Create a helper function, like we have when we create a + # container. + build_container_exec () + { + remote_exec "${build}:$(pwd)" "$@" + } + ;; + *) + # Make sure to cleanup build container if something goes + # wrong when preparing the test environment + trap "cleanup_all_containers" EXIT + ./start-container-docker.sh $docker_host_opt --distro "$build_container_tag" --task build --prefix build_ > build-container.sh + . ./build-container.sh + ;; +esac case "$toolchain_url" in "ssh://"*) - ccprefix="${toolchain_url##ssh://}" if [ x"$sysroot" = x"tarball" ]; then echo "ERROR: Unsupported sysroot $sysroot for toolchain_url $toolchain_url" exit 1 |