Class: Itamae::Runner
- Inherits:
-
Object
- Object
- Itamae::Runner
- Defined in:
- lib/itamae/runner.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#node ⇒ Object
Returns the value of attribute node.
-
#tmpdir ⇒ Object
Returns the value of attribute tmpdir.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node) ⇒ Runner
constructor
A new instance of Runner.
- #load_recipes(paths) ⇒ Object
- #run(options) ⇒ Object
Constructor Details
#initialize(node) ⇒ Runner
Returns a new instance of Runner.
84 85 86 87 88 89 90 91 |
# File 'lib/itamae/runner.rb', line 84 def initialize(node) @node = node @tmpdir = "/tmp/itamae_tmp" @children = RecipeChildren.new Backend.instance.run_command(["mkdir", "-p", @tmpdir]) Backend.instance.run_command(["chmod", "777", @tmpdir]) end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
82 83 84 |
# File 'lib/itamae/runner.rb', line 82 def children @children end |
#node ⇒ Object
Returns the value of attribute node.
80 81 82 |
# File 'lib/itamae/runner.rb', line 80 def node @node end |
#tmpdir ⇒ Object
Returns the value of attribute tmpdir.
81 82 83 |
# File 'lib/itamae/runner.rb', line 81 def tmpdir @tmpdir end |
Class Method Details
.run(recipe_files, backend_type, options) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/itamae/runner.rb', line 8 def run(recipe_files, backend_type, ) Logger.info "Starting Itamae..." (backend_type, ) runner = self.new(()) runner.load_recipes(recipe_files) runner.run(dry_run: [:dry_run]) end |
Instance Method Details
#load_recipes(paths) ⇒ Object
93 94 95 96 97 |
# File 'lib/itamae/runner.rb', line 93 def load_recipes(paths) paths.each do |path| children << Recipe.new(self, File.(path)) end end |
#run(options) ⇒ Object
99 100 101 |
# File 'lib/itamae/runner.rb', line 99 def run() children.run() end |