Commit b98ebd0ccc2d6fc3ffdcfc568e7482a84d2387ae
1 parent
689c41d7
Exists in
master
and in
1 other branch
Update deploy file to copy and link example config files
Showing
1 changed file
with
18 additions
and
1 deletions
Show diff stats
config/deploy.example.rb
... | ... | @@ -29,7 +29,7 @@ set :scm_verbose, true |
29 | 29 | set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") } |
30 | 30 | set :branch, defer { current_branch } |
31 | 31 | |
32 | -after 'deploy:update_code', 'bundler:install' | |
32 | +after 'deploy:update_code', 'errbit:symlink_configs', 'bundler:install' | |
33 | 33 | |
34 | 34 | namespace :deploy do |
35 | 35 | task :start do ; end |
... | ... | @@ -50,4 +50,21 @@ namespace :bundler do |
50 | 50 | bundler.symlink_vendor |
51 | 51 | run("cd #{release_path} && bundle install vendor/bundler_gems --without development test") |
52 | 52 | end |
53 | +end | |
54 | + | |
55 | +namespace :errbit do | |
56 | + task :setup_configs do | |
57 | + shared_configs = File.join(shared_path,'config') | |
58 | + run "mkdir -p #{shared_configs}" | |
59 | + run "if [ ! -f #{shared_configs}/config.yml ]; then cp #{latest_release}/config/config.example.yml #{shared_configs}/config.yml; fi" | |
60 | + run "if [ ! -f #{shared_configs}/mongoid.yml ]; then cp #{latest_release}/config/mongoid.example.yml #{shared_configs}/mongoid.yml; fi" | |
61 | + end | |
62 | + | |
63 | + task :symlink_configs do | |
64 | + errbit.setup_configs | |
65 | + shared_configs = File.join(shared_path,'config') | |
66 | + release_configs = File.join(release_path,'config') | |
67 | + run("ln -nfs #{shared_configs}/config.yml #{release_configs}/config.yml") | |
68 | + run("ln -nfs #{shared_configs}/mongoid.yml #{release_configs}/mongoid.yml") | |
69 | + end | |
53 | 70 | end |
54 | 71 | \ No newline at end of file | ... | ... |