metamaps--metamaps/doc/production/pull-changes.md

35 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

## How to pull changes from github to an instance:
These are the steps we use to pull production code to our server. Feel free to adapt them to your own use. We are using an Ubuntu 14.04 server.
First, run one of these two code blocks. The first is if you've merged the code into the instance/mycoolinstance already. The second is if you'd like to make the merge on the server.
EITHER THIS
git checkout instance/mycoolinstance
2017-10-25 10:44:20 +00:00
git fetch origin instance/mycoolinstance
git reset --hard origin/instance/mycoolinstance
OR
git checkout instance/mycoolinstance
git fetch origin master
git merge origin/master
Now that you have the code, run these commands:
export RAILS_ENV=production
export NODE_ENV=production
source .env
bundle install
2016-11-01 08:31:36 +00:00
bundle exec rails db:migrate
2017-10-25 10:44:20 +00:00
# the following includes `npm install`, `npm run build`, `bin/build-apidocs.sh`, `rails perms:fix`
bundle exec rails assets:precompile
passenger-config restart-app .
forever list #find the uid of the realtime server, e.g. xQKv
forever restart xQKv
sudo service metamaps_delayed_job restart