minor bug fix
[distro-setup] / mastodon-upgrade
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 # based on
7 # https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Docker-Guide.md
8
9 if [[ $EUID == 0 ]]; then echo "$0: error, do not run as root"; exit 1; fi
10
11 cd /home/iank/mastodon
12 git fetch
13 git stash
14 git checkout $(git tag | grep -v rc | tail -n1)
15 git stash pop
16 docker-compose build
17 # these 2 may not be needed in all upgrades, but
18 # simpler to just do them always.
19 docker-compose run --rm web rake db:migrate
20 docker-compose run --rm web rake assets:precompile
21 # restart the app
22 docker-compose up -d