From 342dada8e4aaa583fd389dcb34de915bd4d7c8b1 Mon Sep 17 00:00:00 2001 From: reverite Date: Wed, 4 Apr 2018 14:53:01 -0700 Subject: container update script --- deploy/scripts/update-containers.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) mode change 100755 => 100644 deploy/scripts/update-containers.sh (limited to 'deploy') diff --git a/deploy/scripts/update-containers.sh b/deploy/scripts/update-containers.sh old mode 100755 new mode 100644 index ff63e9e..668e4b4 --- a/deploy/scripts/update-containers.sh +++ b/deploy/scripts/update-containers.sh @@ -3,10 +3,17 @@ [ -z "$COMPOSE" ] && COMPOSE="$(command -v docker-compose)" [ -z "$COMPOSE" ] && COMPOSE="/usr/local/bin/docker-compose" -cd $HOME +cd "$HOME" || exit + +[ -z "$NGINX_WEBHOOK" ] || printf "Content-Type: text/plain\r\n\r\n" + +($COMPOSE pull 2>&1 | grep --silent "Downloaded newer") && { + $COMPOSE up -d + + docker cp "$($COMPOSE ps -q mstweb):/mastodon/public/assets" public/ + docker cp "$($COMPOSE ps -q mstweb):/mastodon/public/packs" public/ -($COMPOSE pull 2>&1 | grep --silent "Downloaded newer") && \ - $COMPOSE up -d && \ - docker cp $($COMPOSE ps -q mstweb):/mastodon/public/assets public/ && \ - docker cp $($COMPOSE ps -q mstweb):/mastodon/public/packs public/ && \ docker image prune -f + + curl -sS "https://raw.githubusercontent.com/pluralcafe/utils/master/deploy/docker-compose.yml" > docker-compose.yml +} -- cgit