Skip to content

Commit

Permalink
Revert "Merge pull request #24 from sdesbure/master"
Browse files Browse the repository at this point in the history
This reverts commit e6190f6, reversing
changes made to ac8282d.
  • Loading branch information
rick committed Sep 29, 2011
1 parent e6190f6 commit 9f8c15f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion README.markdown
Expand Up @@ -150,7 +150,6 @@ Known config file settings (if you're familiar with capistrano and vlad these sh
post_deploy_script: path to a shell script to run after deployment
post_setup_script: path to a shell script to run after setup
rake_env: hash of environment variables to set when running post_setup and post_deploy rake tasks
rake_exec: name of the rake executable to use (useful when using rvm) (default: rake)


A simple config/deploy.yml might look like:
Expand Down
8 changes: 2 additions & 6 deletions lib/whiskey_disk.rb
Expand Up @@ -72,10 +72,6 @@ def env_vars
buffer
end
end

def rake_exec
(self[:rake_exec] and self[:rake_exec] != '') ? self[:rake_exec] : 'rake'
end

def parent_path(path)
File.split(path).first
Expand Down Expand Up @@ -202,7 +198,7 @@ def if_file_present(path, cmd)
end

def if_task_defined(task, cmd)
%Q(rakep=`#{env_vars} #{rake_exec} -P` && if [[ `echo "${rakep}" | grep #{task}` != "" ]]; then #{cmd}; fi )
%Q(rakep=`#{env_vars} rake -P` && if [[ `echo "${rakep}" | grep #{task}` != "" ]]; then #{cmd}; fi )
end

def safe_branch_checkout(path, my_branch)
Expand All @@ -226,7 +222,7 @@ def run_rake_task(path, task_name)
enqueue "echo Running rake #{task_name}..."
enqueue "cd #{path}"
enqueue(if_file_present("#{self[:deploy_to]}/Rakefile",
if_task_defined(task_name, "#{env_vars} #{rake_exec} #{'--trace' if Config.debug?} #{task_name} to=#{self[:environment]}")))
if_task_defined(task_name, "#{env_vars} rake #{'--trace' if Config.debug?} #{task_name} to=#{self[:environment]}")))
end

def build_path(path)
Expand Down
9 changes: 0 additions & 9 deletions spec/whiskey_disk_spec.rb
Expand Up @@ -718,15 +718,6 @@ def system(*args)
WhiskeyDisk.buffer.join(' ').should.match(%r{#{k}='#{v}' })
end
end

it "should use the configured rake executable if one is specified in the conf" do
@parameters = { 'deploy_to' => '/path/to/main/repo', 'rake_exec' => 'weird_exec' }
WhiskeyDisk.configuration = @parameters
WhiskeyDisk.run_post_deploy_hooks
WhiskeyDisk.buffer.join(' ').should =~ %r{weird_exec.*deploy:post_deploy}
WhiskeyDisk.buffer.join(' ').should =~ %r{rakep=\`.*weird_exec -P\` && if \[\[ \`echo "\$\{rakep\}" \| grep deploy:post_deploy\` != "" \]\];}
puts WhiskeyDisk.buffer.join(' ')
end
end

describe 'bundling up buffered commands for execution' do
Expand Down

0 comments on commit 9f8c15f

Please sign in to comment.