From a3a66e895bbe44c9d6e40bb130b6b76530ab48bd Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 13 May 2020 10:44:45 +0000 Subject: tcwg-update-*-containers.sh: Restart containers only on image update Restart host, jenkins node and llvmbot containers only if underlying docker image has changed. This allows us to simplify management of persistent infrastructure containers (host, jenkins node and llvmbot containers) by triggering update job, say, every day, instead of monitoring dockerfiles.git repo for changes. Change-Id: I27ecb27a9d1d4266d68e6fdfcdae98772fa7884d --- tcwg-update-llvmbot-containers.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tcwg-update-llvmbot-containers.sh') diff --git a/tcwg-update-llvmbot-containers.sh b/tcwg-update-llvmbot-containers.sh index 037a5daa..3bc4fe23 100755 --- a/tcwg-update-llvmbot-containers.sh +++ b/tcwg-update-llvmbot-containers.sh @@ -10,11 +10,18 @@ convert_args_to_variables "$@" obligatory_variables NODE_NAME password distro="${distro-xenial}" +force="${force-false}" master="${master-silent}" verbose="${verbose-true}" if $verbose; then set -x; fi +if $force; then + keep_existing=false +else + keep_existing=keep_if_same_image +fi + case "$NODE_NAME:$master" in tcwg-llvmbot_d05-01:normal) bot_prefix=linaro-armv8-01- @@ -52,7 +59,7 @@ for bot in "${bots[@]+${bots[@]}}"; do $scripts/tcwg-start-container.sh \ --container "$master-${bot_prefix}$bot" \ --image "$image" \ - --keep_existing "false" \ + --keep_existing "$keep_existing" \ --verbose "$verbose" \ -- \ $image $master ${bot_prefix}$bot $password -- cgit v1.2.3