mastodon-twitter-poster
mastodon-twitter-poster copied to clipboard
Upgrade procedure missing in README
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?
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