Only run docker pull once in twlight_docker_deploy.sh
@@ -14,14 +14,16 @@ tag=${2}
# Move into the repository.
cd /srv/TWLight
# Check for newer image
-if docker pull wikipedialibrary/twlight:${tag} | grep "Status: Downloaded newer image for wikipedialibrary/twlight:${tag}" >/dev/null
+pull=$(docker pull wikipedialibrary/twlight:${tag})
+
+if echo ${pull} | grep "Status: Downloaded newer image for wikipedialibrary/twlight:${tag}" >/dev/null
then
# Get any new docker-compose or script updates.
git pull
# Deploy the stack
docker stack deploy -c docker-compose.yml -c docker-compose.${env}.yml ${env}
# Report if the local image is already up to date.
-elif docker pull wikipedialibrary/twlight:${tag} | grep "Status: Image is up to date for wikipedialibrary/twlight:${tag}" >/dev/null
+elif echo ${pull} | grep "Status: Image is up to date for wikipedialibrary/twlight:${tag}" >/dev/null
then
echo "Up to date"
# Fail in any other circumstance.
