-
-
Notifications
You must be signed in to change notification settings - Fork 70
Updating QPixel
How exactly you update QPixel will depend on how you installed it in the first place. For instance, if you have the Git repository available, you could pull changes and resolve the resulting merge conflicts with any changes you've made locally; if you have your own fork you've probably already done that in the repository so you may just be able to pull changes directly.
However you obtain updates, there are some steps that need to be followed after each update to ensure everything is updated before restarting your server on the new version.
Gem dependencies are likely to have updated. Run:
bundle install --without development test
Note: The --without
flag is deprecated - although this is the method we use currently, once this is removed you will need to use bundle config without
beforehand instead.
Migrations update your database schema to account for any changes. Run:
RAILS_ENV=production bundle exec rails db:migrate
Some cached items should be cleared during a deployment so that updated versions will be generated with the new version. A script is provided that clears these keys for you. Run:
RAILS_ENV=production bundle exec rails r scripts/clear_cache.rb
The database needs to be seeded (like it was when you initialized the site on installation) to add any new items. Run:
RAILS_ENV=production bundle exec rails db:seed
Assets which form part of the Rails pipeline (like CSS and JavaScript) need to be precompiled to generate static versions that can be served by your reverse proxy. Run:
RAILS_ENV=production bundle exec rails assets:precompile
Images aren't precompiled by the Rails pipeline so just need to be copied into the right directory to be served. Run:
cp app/assets/images/* public/assets
Scheduled jobs may have been updated, so your crontab file needs to be updated to run them. Run:
RAILS_ENV=production bundle exec whenever --update-crontab
You're now ready to restart your server on the new version. If you're running QPixel as a service, run:
sudo systemctl restart qpixel
If you need to restart Puma directly instead:
RAILS_ENV=production bundle exec pumactl -P tmp/pids/server.pid restart