v1.3.2にアップデートした際の手順です。
流れは、サービス停止、バックアップ、git fetch→stash→checkout→stash pop、再ビルド、サービス開始
サービス停止とバックアップ
# cd /home/docker/mastodon
# docker-compose stop
# cd ..
# tar cvfz mastodon-before-update20170430.tgz mastodon
ディレクトリを移動して git fetch
# cd mastodon
# git fetch
git statusで更新内容確認
# git status
HEAD detached at v1.2.2
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: docker-compose.yml
no changes added to commit (use "git add" and/or "git commit -a")
docker-compose.ymlをgit stashでいったん退避。v1.3.2 タグにcheckoutし、stash popでdocker-compose.ymlを復活。
# git stash
# git checkout v1.3.2
# git stash pop
ビルドとdocker、nginxの再起動。
# docker-compose build
# docker-compose up -d
# docker-compose run --rm web rails db:migrate
# docker-compose run --rm web rails assets:precompile
# docker stop $(docker ps -a -q) && docker-compose up -d
# systemctl restart nginx
あとは ~/about/more でバージョンを確認
以上おしまい