lib/capper/config.rb in capper-0.7.3 vs lib/capper/config.rb in capper-0.8.0

- old
+ new

@@ -1,26 +1,24 @@ -require File.dirname(__FILE__) + '/base' unless defined?(Capper) +_cset(:config_repo, nil) -Capper.load do - _cset(:config_repo, nil) +after "deploy:setup", "config:setup" +after "deploy:update_code", "config:deploy" - after "deploy:setup" do +namespace :config do + desc "Setup configuration repository if any" + task :setup, :roles => :app, :except => { :no_release => true } do unless config_repo.nil? run "rm -rf #{config_path} && git clone -q #{config_repo} #{config_path}" end end - namespace :config do - desc "Setup configuration files from config repo" - task :setup, :roles => :app, :except => { :no_release => true } do - unless config_repo.nil? - run "cd #{config_path} && git pull -q" - end + desc "Deploy config files from shared/config to current release" + task :deploy, :roles => :app, :except => { :no_release => true } do + 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(:config_files, []).each do |f| + run "cp #{config_path}/#{f} #{release_path}/config/" end end - - after "deploy:update_code", "config:setup" end