Press enter to see results or esc to cancel.

How To Manage Multiple Heroku Account at Localhost

If we are working on multiple project that some of it hosted at heroku, and each of the them have their own heroku account. May be we will have the problem when we have to do heroku command, because we only install heroku toolbelts once and configure the username and password for our credentials once. 

For example, at work, we have to manage ABCOffice project that being hosted at heroku using company account, and for personal fun or side project, we have ABCPersonal. It will be very troublesome for us if we want to switch between heroku accounts if we just want to manage each of that project. Luckily, there are Heroku plugins to handle all this mess.

at terminal, what you have to do is install this plugins using this command

 heroku plugins:install git://github.com/ddollar/heroku-accounts.git

after that we can add the account, let say personal, by using this command

$ heroku accounts:add personal
Enter your Heroku credentials.
Email: [email protected]
Password: ******

 

then you have to add this at your ~/.ssh/config

Host heroku.personal
  HostName heroku.com
  IdentityFile /PATH/TO/PRIVATE/KEY
  IdentitiesOnly yes

too much things you have to do? actually you can just let all of this happens automagically, using this command 

$ heroku accounts:add work --auto
Enter your Heroku credentials.
Email: [email protected]
Password: ******
Generating new SSH key
Generating public/private rsa key pair.
Your identification has been saved in ~/.ssh/identity.heroku.work.
Your public key has been saved in ~/.ssh/identity.heroku.work.pub.
Adding entry to ~/.ssh/config
Adding public key to Heroku account: [email protected]
Now you can use 

$ heroku accounts:set personal

at you personal project root and use 

$ heroku accounts:set work

at your work


src : https://github.com/ddollar/heroku-accounts





Tags

Comments

Leave a Comment

Show Buttons
Hide Buttons