Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I commit password only to heroku and not to github?

Tags:

git

github

heroku

I have designed an emailer and the SMTP gateway has authentication id and password which resides in the code. Now, I want to commit them to heroku but not to github. There are multiple collaborators on the project. So, I can create a new branch and keep the keys there and deploy it to heroku. This branch stays only locally and does not make it to github. However, if I follow this method, then all collaborators have to maintain a local branch for heroku and always follow the following procedure for deployment: 1. commit changes on master 2. merge master and heroku branches 3. deploy heroku branch

This seems error-prone and repititive. Not elegant.

The other way that occurred to me is to make a commit with the authentication values, push to heroku and then revert the commit. However, I think the authentication values will still make it github, if I do this. Even if github does not have the authentication values, it has to be done every time a collaborator pushes any new feature.

Please suggest.

like image 245
dknight Avatar asked May 29 '12 21:05

dknight


People also ask

Can you push to Heroku without GitHub?

You can use https://github.com/ddollar/heroku-push and push directories without git.

How do I disconnect from Heroku GitHub?

Go to Github and under your personal settings revoke access BUT THEN go back to Heroku, logout, login and you will see a warning from Heroku on the dashboard saying that access has been revoked from your GitHub account. Click on Disconnect on that app.

Does Heroku push to GitHub?

Heroku integrates with GitHub to make it easy to deploy code living on GitHub to apps running on Heroku. When GitHub integration is configured for a Heroku app, Heroku can automatically build and release (if the build is successful) pushes to the specified GitHub repo.


1 Answers

You should be able to put your sensitive information into configuration variables in heroku, and then reference those config/environment variables, instead of directly using the passwords, etc. See Configuration and Config Vars on the Heroku Dev Center.

like image 79
bdukes Avatar answered Oct 17 '22 06:10

bdukes