-
Notifications
You must be signed in to change notification settings - Fork 616
How to deploy to Heroku
ben edited this page Aug 2, 2015
·
13 revisions
- First go to Heroku and create a new app (e.g.: example-democracyos) containing an instance of MongoLab.
- Go to the app dashboard settings in https://dashboard.heroku.com/apps/example-democracyos/settings and copy the Git URL. In this case, it's git@heroku.com:example-democracyos.git
- Add this as a remote in your app directory with the command
git remote add heroku git@heroku.com:example-democracyos.git
. You can name it whatever you want:git remote add whatever git@heroku.com:example-democracyos.git
. - Add the config variables needed for the app to work using
heroku config:set VAR_NAME=VALUE VAR_NAME2=VALUE2
etc. - Push the code with
git push heroku master
. Always push to the heroku's master branch for the changes to take effect.
The app should be running
TL;DR (or I'll do it from the command line)
➜ eg git:(master) heroku apps:create example-democracyos
➜ eg git:(master) heroku addons:add mongolab
➜ eg git:(master) heroku addons:add mandrill
➜ eg git:(master) heroku config:set NODE_ENV=production NODE_PATH=.
➜ eg git:(master) heroku config:set GITHUB_USERNAME=your-github-username GITHUB_PASSWORD=your-github-api-token
Note: heroku add ons:add mongolab
sets environment variable MONGO_URI
, but MONGO_URL
is required.
Run heroku config
to see your MONGO_URI
, and then heroku config:set MONGO_URL=<what your MONGO_URI was>
Visit our official website - Developed by Democracia en Red and contributors from the world over!