lib/capper/config.rb in capper-0.2.4 vs lib/capper/config.rb in capper-0.3.0
- old
+ new
@@ -1,13 +1,25 @@
require File.dirname(__FILE__) + '/base' unless defined?(Capper)
Capper.load do
- _cset(:config_repo) { abort "Please specify the config repository, set :config_repo, 'foo'" }
+ _cset(:config_repo, nil)
after "deploy:setup" do
- run "rm -rf #{config_path} && git clone #{config_repo} #{config_path}"
+ unless config_repo.nil?
+ run "rm -rf #{config_path} && git clone -q #{config_repo} #{config_path}"
+ end
end
after "deploy:update_code" do
- run "cd #{config_path} && git pull"
+ unless config_repo.nil?
+ run "cd #{config_path} && git pull -q"
+ end
+
+ fetch(:config_files, []).each do |f|
+ run "cp #{config_path}/#{f} #{release_path}/config/"
+ end
+
+ fetch(:symlinks, {}).each do |source, dest|
+ run "rm -rf #{release_path}/#{dest} && ln -nfs #{shared_path}/#{source} #{release_path}/#{dest}"
+ end
end
end