From b139d2cc931efb5c2699e2d46ce2ba044f8fd4e6 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Wed, 8 Feb 2017 20:48:51 +0000 Subject: start-container*.sh: Add --task parameter. Change-Id: I869c0693531b05958e4e482d15d901da9b57ca71 --- start-container-schroot.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'start-container-schroot.sh') diff --git a/start-container-schroot.sh b/start-container-schroot.sh index 475be412..1d57409b 100755 --- a/start-container-schroot.sh +++ b/start-container-schroot.sh @@ -13,13 +13,14 @@ set -e # a remote connexion to the container usage() { - echo Usage: $0 --arch container-arch --distro flavour [--session-host host] [--session-name name] + echo "Usage: $0 --arch container-arch --distro flavour [--session-host host] [--session-name name] [--task {build|test}]" echo echo " container-arch: architecture (eg: amd64, i386, arm64, armhf)" echo " distro: distribution (eg: trusty)" 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 " task: type of container (build or test, default=build)" exit 1 } @@ -33,6 +34,7 @@ container_arch= distro= session_host= session_name= +task="build" while [ $# -ge 1 ] do @@ -57,6 +59,11 @@ do [ x${session_name} = x ] && usage shift 2 ;; + --task) + task=$2 + [ x${task} = x ] && usage + shift 2 + ;; *) echo "Unsupported option: $1" usage @@ -71,7 +78,7 @@ done session_host=${session_host}.tcwglab session_port=22 -schroot_image="tcwg-build-${container_arch}-${distro}" +schroot_image="tcwg-${task}-${container_arch}-${distro}" SCHROOT="ssh -p ${session_port} -A ${session_host} schroot" session_id=$(${SCHROOT} -b -c chroot:$schroot_image --preserve-environment) -- cgit v1.2.3