Commit c6993e4

mo khan <mo@mokhan.ca>
2015-05-23 01:18:11
add database.yml
1 parent a12f708
Changed files (2)
recipes
templates
recipes/capistrano.rb
@@ -33,3 +33,15 @@ template "#{shared_path}/.env" do
   mode "0600"
   variables(configuration)
 end
+
+template "#{shared_path}/config/database.yml" do
+  source "database.yml.erb"
+  mode "0664"
+  variables({
+    rails_env: node.chef_environment,
+    database: node['postgres']["database"],
+    username: node['postgres']['user'],
+    password: node['postgres']["password"],
+    host: node['postgres']['host'],
+  })
+end
templates/default/database.yml.erb
@@ -0,0 +1,8 @@
+<%= @rails_env %>:
+  adapter: postgresql
+  encoding: unicode
+  pool: 5
+  database: <%= @database %>
+  username: <%= @username %>
+  password: <%= @password %>
+  host: <%= @host %>