Class: Bow::Commands::Apply

Inherits:
Bow::Command show all
Defined in:
lib/bow/commands/apply.rb

Instance Attribute Summary

Attributes inherited from Bow::Command

#app

Instance Method Summary collapse

Methods inherited from Bow::Command

#command_name, command_name, find, inherited, #initialize, #targets, #usage

Constructor Details

This class inherits a constructor from Bow::Command

Instance Method Details

#descriptionObject



6
7
8
# File 'lib/bow/commands/apply.rb', line 6

def description
  'Apply provision on remote hosts.'
end

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bow/commands/apply.rb', line 10

def run
  ThreadPool.new do |t|
    t.from_enumerable targets do |host|
      results = app.ssh_helper(host).prepare_provision
      ResponseFormatter.multi_print(host, results)

      cmd = "rake #{host.group}:provision"
      result = app.ssh_helper(host).execute(cmd, true)
      ResponseFormatter.pretty_print(host, result)
    end
  end
end