I want to add a remote git collaborator on one of my projects, but I do not want to have him access my passwords in database.yml. I know how to .gitignore database.yml and purge the repo accordingly, but the trouble is I am deploying this particular project to DotCloud, which, as far as I know, requires the database.yml to be part of the git repo. The best solution I can think of now is using rsync to push to DotCloud, but I'd rather push directly from the git repo. Anyone know of a way I can do this?
You have a couple of different options depending on what you want to do.
You can put the database.yml
file in your .gitignore file
, and then when using dotcloud push use rsync instead of git to push your code.
$ dotcloud push --all ramen
Using the --all
option will force the uploader to use the “rsync” method, and therefore push all your files. See this page for more info. http://docs.dotcloud.com/guides/git-hg/#pushing-uncomitted-changes
If you need to ignore files then you can create a .dotcloudignore
file, and add the files you want to ignore with the push there.
The second, better approach is to not put your passwords in your database.yml
file at all. Add your passwords as environment variables, and then your database.yml
file can be safe and free of passwords.
$ dotcloud var set myapp MYVAR=MYVALUE
You can then reference the variables the same way as you do with environment.yml
or environment.json
. More info can be found here: http://docs.dotcloud.com/guides/environment/#adding-environment-variables