Class: Mrsk::Cli::Build

Inherits:
Base
  • Object
show all
Defined in:
lib/mrsk/cli/build.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Mrsk::Cli::Base

Instance Method Details

#createObject



31
32
33
34
35
36
# File 'lib/mrsk/cli/build.rb', line 31

def create
  run_locally do
    debug "Using builder: #{MRSK.builder.name}"
    execute *MRSK.builder.create
  end
end

#deliverObject



5
6
7
8
# File 'lib/mrsk/cli/build.rb', line 5

def deliver
  invoke :push
  invoke :pull
end

#detailsObject



47
48
49
50
51
52
# File 'lib/mrsk/cli/build.rb', line 47

def details
  run_locally do
    puts "Builder: #{MRSK.builder.name}"
    puts capture(*MRSK.builder.info)
  end
end

#pullObject



26
27
28
# File 'lib/mrsk/cli/build.rb', line 26

def pull
  on(MRSK.hosts) { execute *MRSK.builder.pull }
end

#pushObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mrsk/cli/build.rb', line 11

def push
  verbose = options[:verbose]

  run_locally do 
    begin
      MRSK.verbosity(:debug) { execute *MRSK.builder.push }
    rescue SSHKit::Command::Failed => e
      error "Missing compatible builder, so creating a new one first"
      execute *MRSK.builder.create
      MRSK.verbosity(:debug) { execute *MRSK.builder.push }
    end
  end
end

#removeObject



39
40
41
42
43
44
# File 'lib/mrsk/cli/build.rb', line 39

def remove
  run_locally do
    debug "Using builder: #{MRSK.builder.name}"
    execute *MRSK.builder.remove
  end
end