Skip to content
Browse files

Update deploy file to copy and link example config files

  • Loading branch information...
1 parent 689c41d commit b98ebd0ccc2d6fc3ffdcfc568e7482a84d2387ae @jdpace jdpace committed
Showing with 18 additions and 1 deletion.
  1. +18 −1 config/deploy.example.rb
View
19 config/deploy.example.rb
@@ -29,7 +29,7 @@
set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") }
set :branch, defer { current_branch }
-after 'deploy:update_code', 'bundler:install'
+after 'deploy:update_code', 'errbit:symlink_configs', 'bundler:install'
namespace :deploy do
task :start do ; end
@@ -50,4 +50,21 @@
bundler.symlink_vendor
run("cd #{release_path} && bundle install vendor/bundler_gems --without development test")
end
+end
+
+namespace :errbit do
+ task :setup_configs do
+ shared_configs = File.join(shared_path,'config')
+ run "mkdir -p #{shared_configs}"
+ run "if [ ! -f #{shared_configs}/config.yml ]; then cp #{latest_release}/config/config.example.yml #{shared_configs}/config.yml; fi"
+ run "if [ ! -f #{shared_configs}/mongoid.yml ]; then cp #{latest_release}/config/mongoid.example.yml #{shared_configs}/mongoid.yml; fi"
+ end
+
+ task :symlink_configs do
+ errbit.setup_configs
+ shared_configs = File.join(shared_path,'config')
+ release_configs = File.join(release_path,'config')
+ run("ln -nfs #{shared_configs}/config.yml #{release_configs}/config.yml")
+ run("ln -nfs #{shared_configs}/mongoid.yml #{release_configs}/mongoid.yml")
+ end
end

0 comments on commit b98ebd0

Please sign in to comment.
Something went wrong with that request. Please try again.