mastodon-twitter-poster icon indicating copy to clipboard operation
mastodon-twitter-poster copied to clipboard

Upgrade procedure missing in README

Open jacotec opened this issue 5 years ago • 1 comments

After my first attempt to deploy the Crossposter was not very successful, I took some two hours and started over, writing myself some a documentation in case I need to redo the setup somewhere later.

To complete my doc I'd like to know the needed steps for performing an upgrade. The assumed steps are:

  • Stop the services
  • Change to the crossposter user and change into "live" directory
  • "git pull"

In case some dependencies or Ruby version has changed:

bundle install --deployment --without development test
yarn install --pure-lockfile

Precompile: RAILS_ENV=production bundle exec rake assets:precompile

  • Restart services

Is this correct? Is there some command for a database migration / update needed?

jacotec avatar Jul 20 '19 13:07 jacotec

Usually when there's changes, they are listed in the Changelog, such as these https://github.com/renatolond/mastodon-twitter-poster/blame/master/CHANGELOG.md#L11

Database migrations are done with RAILS_ENV=production bundle exec rails db:migrate

To upgrade you don't need to stop the services, you can git pull and restart the services after. Usually the steps would be:

  • change to the crossposter user
  • change into the live directory (or equivalent)
  • git pull the new version
  • (if ruby dependencies changed) bundle install
  • (if node dependencies changed) yarn install --pure-lockfile
  • (if assets changed) RAILS_ENV=production bundle exec rake assets:precompile
  • (if database changed) RAILS_ENV=production bundle exec rails db:migrate
  • restart services

renatolond avatar Jul 21 '19 15:07 renatolond