Class: Larrow::Runner::Manifest::CmdStep

Inherits:
Object
  • Object
show all
Defined in:
lib/larrow/runner/manifest/configuration.rb

Overview

Describe a set of scripts to accomplish a specific goal

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scripts, title) ⇒ CmdStep

Returns a new instance of CmdStep.



79
80
81
82
# File 'lib/larrow/runner/manifest/configuration.rb', line 79

def initialize scripts, title
  self.scripts = scripts || []
  self.title = title
end

Instance Attribute Details

#scriptsObject

Returns the value of attribute scripts.



78
79
80
# File 'lib/larrow/runner/manifest/configuration.rb', line 78

def scripts
  @scripts
end

#titleObject

Returns the value of attribute title.



78
79
80
# File 'lib/larrow/runner/manifest/configuration.rb', line 78

def title
  @title
end

Instance Method Details

#run_on(node, verbose: nil) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/larrow/runner/manifest/configuration.rb', line 84

def run_on node, verbose:nil
  verbose = title.to_s.end_with?('test') if verbose.nil?
  scripts.each do |script|
    node.execute(script.actual_command, 
                 base_dir: script.base_dir,
                 verbose: verbose)
  end
end