Skip to content
Arunadevi edited this page Jul 16, 2013 · 1 revision

Pre-requisites

  1. Go to heroku.com and create a new account. The Heroku username should be given permissions.(need info)
  2. Install heroku toolbelt from https://toolbelt.heroku.com/ (this should automatically install git also)

Test the tool belt installation by opening a command prompt typing git --version and after that heroku version.

Local settings

Create 3 separate directories: "work", "test" and "production".

  • "work" contains all the source code from Github.
  • "test" contains all the sources that will be deployed to the Heroku test environment - http://carmindz-test-on-heroku.herokuapp.com/. To avoid unwanted problems, before pushing to production, always push here first.
  • "production" contains all the sources that will be deployed to production. The app deployed here will be visible on carmindz.in. Hence pushing to production requires exercising caution.

Preparing to deploy

  • Make sure all changes that need to be deployed are pushed to Github.
  • Open command prompt and navigate to "test" folder.
  • git clone https://github.com/Coena/carmindz-heroku.git. This requires Github authentication. The latest code(along with the changes to be deployed) is obtained when cloning.
  • When cloning is done, cd into the carmindz-heroku directory, and type git remote -v It should display: origin https://github.com/Coena/carmindz-heroku.git (fetch) origin https://github.com/Coena/carmindz-heroku.git (push)
  • git pull origin [branch]. Specify the branch that contains the changes to be deployed
  • When pull is done, type, git remote add heroku git@heroku. com:carmindz-test-on-heroku.git
  • After creating the remotes for heroku, typing git remote -v should display heroku git@heroku.com:carmindz-test-on-heroku.git (fetch) heroku git@heroku.com:carmindz-test-on-heroku.git (push) origin https://github.com/Coena/carmindz-heroku.git (fetch) origin https://github.com/Coena/carmindz-heroku.git (push)

Deploying

Pushing the changes to Heroku is done using git push heroku master

  • When pushing for the first time, ensure that your keys are already on Heroku. If you haven’t already uploaded them, run ssh-keygen -t rsa to generate the keys
  • heroku keys:add <file_path> uploads the keys
  • git push heroku master pushes all the changes to the Heroku test environment
  • A push to heroku might require that a `heroku pull origin master' be executed first if source already deployed has to be merged with the one in Github.
  • The updated application can be accessed from http://carmindz-test-on-heroku.herokuapp.com/

Subsequent updates to heroku test environment can be done using git pull origin and git push heroku

Clone this wiki locally