Skip to content

Instantly share code, notes, and snippets.

@momoseijin
Last active October 5, 2019 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save momoseijin/4c692cd87012992315bd16de12bbc715 to your computer and use it in GitHub Desktop.
Save momoseijin/4c692cd87012992315bd16de12bbc715 to your computer and use it in GitHub Desktop.
Update from Mastodon v2.9.3 to v3.0.0
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodon ユーザになる
sudo su - mastodon
#今回の Ruby 2.6.5 のアップデートをするためにrbenvのおいてあるディレクトリに移り最新版をダウンロード
cd ~/.rbenv
git pull
#同じようにプラグインのディレクトリに移り最新版をダウンロード
cd ~/.rbenv/plugins/ruby-build
git pull
#rbenv のディレクトリに戻り rbenv から Ruby を 2.6.5 へ
cd ~/.rbenv
rbenv install 2.6.5
rbenv global 2.6.5
rbenv rehash
#Mastodon のディレクトリに戻って v3.0.0 をもってくる
cd ~/live
git fetch
git tag
git checkout v3.0.0
#git branchでチェック
git branch
#こんな表示になる
$ git branch
* (detached from v3.0.0)
master
#リリースノートにあるように処理をすすめる
bundle install --deployment --without development test
yarn install --pure-lockfile
SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile
#ここで一回 Mastodon をリスタートするため root に戻ってリスタート
exit
systemctl restart mastodon-{web,sidekiq,streaming}.service
#再度 Madtodon ユーザになってキャッシュのクリアともう一回 db:migrate
sudo su - mastodon
cd ~/live
RAILS_ENV=production bin/tootctl cache clear
RAILS_ENV=production bundle exec rails db:migrate
#root に戻って再度リスタート
exit
systemctl restart mastodon-{web,sidekiq,streaming}.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment