metamaps--metamaps/doc/production/pull-changes.md
Devin Howard 6997142fd9 finish integrating npm. move underscore/backbone into npm management (#577)
* finish integrating npm. move underscore/backbone into npm management

* update docs for npm integration

* allow jsx or js extension

* change underscore version
2016-08-01 15:59:53 -04:00

1.1 KiB

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
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
(cd frontend && npm install && npm run build)
rake db:migrate
rake assets:precompile
rake perms:fix
passenger-config restart-app .

cd realtime
npm install
forever list #find the uid, e.g. xQKv
forever restart xQKv

sudo service metamaps_delayed_job restart