lib/alpha_omega/deploy.rb in alpha_omega-0.0.220 vs lib/alpha_omega/deploy.rb in alpha_omega-0.0.222

- old
+ new

@@ -31,10 +31,11 @@ # ========================================================================= # These variables may be set in the client capfile if their default values # are not sufficient. # ========================================================================= + _cset :skip_scm, false _cset :scm, :git _cset :deploy_via, :checkout _cset(:branch) { AlphaOmega.what_branch } _cset(:revision) { source.head } @@ -276,15 +277,15 @@ end task :bootstrap_code do if releases.length < 2 # without services and run as root run "[[ -d #{deploy_to} ]] || #{try_sudo} install -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{root_user} -g #{root_group}"} #{deploy_to}" - run "#{try_sudo} install -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{user} -g #{group}"} #{releases_path} #{deploy_to}/log" + run "#{try_sudo} install -d -m #{dir_perms}#{try_sudo.empty? ? '' : " -o #{user} -g #{group}"} #{releases_path} #{deploy_to}/#{log_dir} #{deploy_to}/#{cache_dir} #{deploy_to}/#{service_dir}" else dirs = [ releases_path, service_path, log_path, cache_path ] dir_args = dirs.map {|d| d.sub("#{deploy_to}/", "") }.join(' ') - run "#{try_sudo} install -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{user} -g #{group}"} #{deploy_to}" + run "#{try_sudo} install -d -m #{dir_perms}#{try_sudo.empty? ? '' : " -o #{user} -g #{group}"} #{deploy_to}" run "cd #{deploy_to} && install -d -m #{dir_perms} #{dir_args}" end end desc <<-DESC @@ -293,12 +294,11 @@ servers. You will rarely call this task directly, however; instead, you \ should call the `deploy' task (to do a complete deploy) or the `update' \ task (if you want to perform the `restart' task separately). DESC task :update_code do - bootstrap_code - strategy.deploy! + strategy.deploy! unless skip_scm bundle cook unless deploy_path_name == migrate_path_name build dist @@ -587,18 +587,14 @@ puts "deploy locked by #{lock_user} #{epoch-lock_epoch} seconds ago" puts "use bin/unlock to remove this lock" abort end - run_script = <<-SCRIPT - echo #{epoch} #{ENV['AO_USER']} > #{lock_path}; - SCRIPT - if want_unlock at_exit { self.unlock; } end - run run_script.gsub(/[\n\r]+[ \t]+/, " ") + run "echo #{epoch} #{ENV['AO_USER']} > #{lock_path}" end task :lock_compare do set :lock_name, :compare lock