X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=disabled%2Fmastodon-upgrade;fp=disabled%2Fmastodon-upgrade;h=a60604980b105601388d768829caf69f4292fed3;hb=d67edcdca8795a4bca116aa532d02dda246a6f53;hp=0000000000000000000000000000000000000000;hpb=a9e3d60b4254cd5c6216c4b3e7f8cd5cc5107fad;p=distro-setup diff --git a/disabled/mastodon-upgrade b/disabled/mastodon-upgrade new file mode 100755 index 0000000..a606049 --- /dev/null +++ b/disabled/mastodon-upgrade @@ -0,0 +1,22 @@ +#!/bin/bash + +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR + +# based on +# https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Docker-Guide.md + +if [[ $EUID == 0 ]]; then echo "$0: error, do not run as root"; exit 1; fi + +cd /home/iank/mastodon +git fetch +git stash +git checkout $(git tag | grep -v rc | tail -n1) +git stash pop +docker-compose build +# these 2 may not be needed in all upgrades, but +# simpler to just do them always. +docker-compose run --rm web rake db:migrate +docker-compose run --rm web rake assets:precompile +# restart the app +docker-compose up -d