Skip to content

Commit ab1d79d

Browse files
committed
restore database config, update deploy config
1 parent 9f6f8f0 commit ab1d79d

File tree

2 files changed

+107
-4
lines changed

2 files changed

+107
-4
lines changed

config/database.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# PostgreSQL. Versions 9.1 and up are supported.
2+
#
3+
# Install the pg driver:
4+
# gem install pg
5+
# On OS X with Homebrew:
6+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7+
# On OS X with MacPorts:
8+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9+
# On Windows:
10+
# gem install pg
11+
# Choose the win32 build.
12+
# Install PostgreSQL and put its /bin directory on your path.
13+
#
14+
# Configure Using Gemfile
15+
# gem 'pg'
16+
#
17+
default: &default
18+
adapter: postgresql
19+
encoding: unicode
20+
template: template0
21+
# For details on connection pooling, see rails configuration guide
22+
# http://guides.rubyonrails.org/configuring.html#database-pooling
23+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
24+
host: localhost
25+
port: 5432
26+
username: postgres
27+
password:
28+
29+
development:
30+
<<: *default
31+
database: filter_api_development
32+
33+
# The specified database role being used to connect to postgres.
34+
# To create additional roles in postgres see `$ createuser --help`.
35+
# When left blank, postgres will use the default role. This is
36+
# the same name as the operating system user that initialized the database.
37+
#username: filter_api
38+
39+
# The password associated with the postgres role (username).
40+
#password:
41+
42+
# Connect on a TCP socket. Omitted by default since the client uses a
43+
# domain socket that doesn't need configuration. Windows does not have
44+
# domain sockets, so uncomment these lines.
45+
#host: localhost
46+
47+
# The TCP port the server listens on. Defaults to 5432.
48+
# If your server runs on a different port number, change accordingly.
49+
#port: 5432
50+
51+
# Schema search path. The server defaults to $user,public
52+
#schema_search_path: myapp,sharedapp,public
53+
54+
# Minimum log levels, in increasing order:
55+
# debug5, debug4, debug3, debug2, debug1,
56+
# log, notice, warning, error, fatal, and panic
57+
# Defaults to warning.
58+
#min_messages: notice
59+
60+
# Warning: The database defined as "test" will be erased and
61+
# re-generated from your development database when you run "rake".
62+
# Do not set this db to the same as development or production.
63+
test:
64+
<<: *default
65+
database: filter_api_test
66+
67+
# As with config/secrets.yml, you never want to store sensitive information,
68+
# like your database password, in your source code. If your source code is
69+
# ever seen by anyone, they now have access to your database.
70+
#
71+
# Instead, provide the password as a unix environment variable when you boot
72+
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
73+
# for a full rundown on how to provide these environment variables in a
74+
# production deployment.
75+
#
76+
# On Heroku and other platform providers, you may have a full connection URL
77+
# available as an environment variable. For example:
78+
#
79+
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
80+
#
81+
# You can use this database configuration with:
82+
#
83+
# production:
84+
# url: <%= ENV['DATABASE_URL'] %>
85+
#
86+
production:
87+
<<: *default
88+
database: filter_api_development

config/deploy.rb

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# They will be linked in the 'deploy:link_shared_paths' step.
2727
# set :shared_dirs, fetch(:shared_dirs, []).push('config')
2828
# set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml')
29-
set :shared_dirs, fetch(:shared_dirs, []).push('config', 'tmp/sockets', 'tmp/pids')
29+
set :shared_dirs, fetch(:shared_dirs, []).push('tmp/sockets', 'tmp/pids')
3030
set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'Gemfile.lock')
3131

3232
# This task is the environment that is loaded all remote run commands, such as
@@ -73,10 +73,11 @@
7373
# Put things that will set up an empty directory into a fully set-up
7474
# instance of your project.
7575
invoke :'git:clone'
76-
invoke :'deploy:link_shared_paths'
76+
# invoke :'deploy:link_shared_paths'
77+
invoke :'my_link_paths'
7778
invoke :'bundle:install'
78-
invoke :'rails:db_migrate'
79-
invoke :'rails:assets_precompile'
79+
# invoke :'rails:db_migrate'
80+
# invoke :'rails:assets_precompile'
8081
invoke :'deploy:cleanup'
8182

8283
on :launch do
@@ -91,6 +92,20 @@
9192
# run :local { say 'done' }
9293
end
9394

95+
task :my_link_paths do
96+
comment %{Symlinking my shared paths}
97+
98+
fetch(:shared_dirs, []).each do |linked_dir|
99+
command %{mkdir -p #{File.dirname("./#{linked_dir}")}}
100+
command %{rm -rf "./#{linked_dir}"}
101+
command %{ln -s "#{fetch(:shared_path)}/#{linked_dir}" "./#{linked_dir}"}
102+
end
103+
104+
fetch(:shared_files, []).each do |linked_path|
105+
command %{ln -sf "#{fetch(:shared_path)}/#{linked_path}" "./#{linked_path}"}
106+
end
107+
end
108+
94109
# For help in making your deploy script, see the Mina documentation:
95110
#
96111
# - https://github.com/mina-deploy/mina/docs

0 commit comments

Comments
 (0)