From 805905fbbd65dda527d184b754db9501e7ec9115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 28 Aug 2018 11:20:33 +0200 Subject: [PATCH] Silent download the new version of the image Also print the new version in the temp file. --- docker/check.rocketchat.update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/check.rocketchat.update b/docker/check.rocketchat.update index 6d08d04..8903809 100755 --- a/docker/check.rocketchat.update +++ b/docker/check.rocketchat.update @@ -2,6 +2,7 @@ # Purpose {{{ ## Create a temp file (to monitor) if an upgrade is available for rocket.chat ## image on the Docker Hub. +## Download the new version of the image. ## How-to use {{{ ### 1. Needs imagetags script, in the same directory ### cf. https://git.ipr.univ-rennes1.fr/cellinfo/scripts/src/master/docker/imagetags @@ -37,6 +38,7 @@ if [ ! $(docker container ls | grep -q -- "${rkt_repo_name}${rkt_image_name}") ] [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test ${rkt_image_name} — Current version is ${rkt_current_version}." else [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test ${rkt_image_name} — No container runs with ${rkt_image_name} image on this host." + rm -f -- "${rkt_new_version_file}" exit 1 fi # }}} @@ -46,6 +48,8 @@ if [ "${rkt_current_version}" != "${rkt_new_version}" ]; then [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — An upgrade is available for ${rkt_image_name}: ${rkt_new_version}." # Create a temp file to monitor touch -- "${rkt_new_version_file}" + printf '\e[1;35m%-6s\e[m\n' "An upgrade is available for ${rkt_image_name}: ${rkt_new_version}." >> "${rkt_new_version_file}" + docker pull "${rkt_repo_name}/${rkt_image_name}:${rkt_new_version}" > /dev/null else [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date." rm -f -- "${rkt_new_version_file}"