I'm deploying my first app on Heroku, and I want to push a file which isn't in my version control (my database.yml
). How to do it?
Asked
Active
Viewed 757 times
1

Janko
- 8,985
- 7
- 34
- 51
-
why is it not in your version control? This is the sort of thing that goes into your version control. – daniel Feb 29 '12 at 19:09
-
1Because I have the database password in it. – Janko Feb 29 '12 at 19:11
-
do you use dedicated pg server? why you need to supply password to heroku? – AMIC MING Feb 29 '12 at 19:17
-
No, I use a shared server. The thing is that I actually don't need to set it. I just set it because I figured it isn't secure otherwise. – Janko Feb 29 '12 at 19:23
-
You are the owner of your database, and in shared database - You can't change your password. You may be able to get support to do it if you logged a ticket although they'll probably want a valid reason. – AMIC MING Feb 29 '12 at 19:32
-
Does that mean that my database on Heroku already has a password? If that's the case, then great, because I don't care what the password is, I just want my database to have it. – Janko Feb 29 '12 at 19:37
-
yes, if you look at the output of heroku config you will see a SHARED_DATABASE entry which looks like a URL - that has the username and password in it to your database. – John Beynon Feb 29 '12 at 20:09
2 Answers
1
You can't. If it was another type of file, you can always use S3 and pull it from there, but this is a file your app needs to start, so you need it on git.

daniel
- 9,732
- 7
- 42
- 57
-
How do I set the password, then? I thought it's usual practice that it's ignored, just for that reason. I'm not really a security freak, but everybody says that you should have a password for your database. – Janko Feb 29 '12 at 19:26
-
Yeah, but I'm not sure if ERB works in my database.yml file, since I'm using Haml. When I tried before, it didn't work, and I was using a gem that was enabling it (but only when I pull it through one of his methods). So my problem is that I don't know a way to check if `password: <%= ENV["DATABASE_PASSWORD"] %>` sets password to the content of `DATABASE_PASSWORD` variable, or if it sets the password to `"<%= ENV["DATABASE_PASSWORD"] %>"` – Janko Mar 01 '12 at 05:57
0
Simple answer is NO, you can do Importing and Exporting Your Data (db), but single file you have to place in git, that's good way or use amazon s3

AMIC MING
- 6,306
- 6
- 46
- 62