Class: Papa::Command::Larga::Deploy

Inherits:
Base
  • Object
show all
Defined in:
lib/papa/command/larga/deploy.rb

Constant Summary collapse

RELEASE_OR_INTEGRATION_LIFESPAN =
'3d'
RELEASE_OR_INTEGRATION_PROTECTION =
'off'

Instance Attribute Summary

Attributes inherited from Base

#command, #exit_status, #silent, #stderr, #stdout

Instance Method Summary collapse

Methods inherited from Base

#cleanup, #success?

Constructor Details

#initialize(options) ⇒ Deploy

Returns a new instance of Deploy.



10
11
12
13
14
15
# File 'lib/papa/command/larga/deploy.rb', line 10

def initialize(options)
  @options = options

  command = "larga #{larga_options.join(' ')}"
  super(command, silent: false)
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/papa/command/larga/deploy.rb', line 32

def failed?
  stdout.include?('Cowardly refusing') || stdout.include?('Error')
end

#failure_messageObject



27
28
29
30
# File 'lib/papa/command/larga/deploy.rb', line 27

def failure_message
  message = "Error while running #{command.bold}"
  Helper::Output.error message
end

#runObject



17
18
19
20
21
22
23
24
25
# File 'lib/papa/command/larga/deploy.rb', line 17

def run
  Helper::Output.stdout "Running #{command.bold}..."
  @stdout = ''
  IO.popen(command).each do |line|
    @stdout << line
    Helper::Output.info line
  end
  self
end