LoginSignup
1
3

More than 5 years have passed since last update.

Dockerを使ったMastodonを1.3.2から1.4.3にバージョンアップした

Last updated at Posted at 2017-06-17

Dockerを使ったMastodonを1.3.2から1.4.3にバージョンアップしました。

念のためにディレクトリを退避

※/opt/mastodonにdocker-compose.yml以下を配置しているとします。

cd /opt
cp -R mastodon mastodon_bak

1.4.3をgitで取得する

git stash
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
git stash pop

ここで、 Google アナリティクス用のスクリプトを設定しているので、app/views/home/index.html.hamlでコンフリクトが発生したので手動で修正しました。

buildしてupする

docker-compose build
docker-compose up -d

プリコンパイルする

docker-compose run --rm web rails assets:precompile

マイグレーションする

docker-compose run --rm web rails db:migrate

ここで、外部キーに関するエラーがでたので下記を実行しました。

docker-compose run --rm web rails mastodon:maintenance:prepare_for_foreign_keys

再度、マイグレーションを実行します。

docker-compose run --rm web rails db:migrate

次回アップデートのために修正した「app/views/home/index.html.haml」をリポジトリに追加してコミットする。

git add app/views/home/index.html.haml
git commit -m "V1.4.3" ... とりあえず現在のバージョンをコメントにする。

以上でバージョンアップは終了です。

参考にした情報

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3