diff options
author | reverite <samantha@chalker.io> | 2018-04-04 14:53:01 -0700 |
---|---|---|
committer | reverite <samantha@chalker.io> | 2018-04-04 14:53:01 -0700 |
commit | 342dada8e4aaa583fd389dcb34de915bd4d7c8b1 (patch) | |
tree | 36fe766094f0d6859e19c01f583815b7128bf5bc /deploy/scripts/update-containers.sh | |
parent | 1d053d83aa9e11d039fddd8df1fc6441d2e27caa (diff) |
container update script
Diffstat (limited to 'deploy/scripts/update-containers.sh')
-rw-r--r--[-rwxr-xr-x] | deploy/scripts/update-containers.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/deploy/scripts/update-containers.sh b/deploy/scripts/update-containers.sh index ff63e9e..668e4b4 100755..100644 --- 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 +} |