Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/inploy/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module DSL
module ClassMethods
def define_callbacks(*callbacks)
callbacks.each do |callback|
define_method callback do |&block|
instance_variable_set "@#{callback}", block
end
class_eval <<-METHOD
def #{callback} &block
instance_variable_set("@#{callback}", block)
end
METHOD
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def setup(subject)

it "should exec the commands in all hosts" do
subject.hosts = ['host0', 'host1', 'host2']
3.times.each do |i|
3.times do |i|
expect_command "ssh #{@ssh_opts} #{@user}@host#{i} 'cd #{@path}/#{@application} && rake inploy:local:update RAILS_ENV=#{@environment} environment=#{@environment}'"
end
subject.remote_update
Expand Down
2 changes: 1 addition & 1 deletion spec/rails3_push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

it "should push git repository and runs the local update on all hosts" do
subject.hosts = ['host0', 'host1', 'host2']
3.times.each do |i|
3.times do |i|
expect_command "git push -f batman@host#{i}:/fakie/path/robin live"
expect_command "ssh #{@ssh_opts} batman@host#{i} 'cd /fakie/path/robin && git reset --hard && git clean -f -d -e public/system && git submodule update --init && bundle install --deployment'"
expect_command "ssh #{@ssh_opts} batman@host#{i} 'cd /fakie/path/robin && rake inploy:local:update RAILS_ENV=production environment=production'"
Expand Down