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.
77 78 79 80 81 82 83 84 |
# File 'lib/itamae/runner.rb', line 77 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.
75 76 77 |
# File 'lib/itamae/runner.rb', line 75 def children @children end |
#node ⇒ Object
Returns the value of attribute node.
73 74 75 |
# File 'lib/itamae/runner.rb', line 73 def node @node end |
#tmpdir ⇒ Object
Returns the value of attribute tmpdir.
74 75 76 |
# File 'lib/itamae/runner.rb', line 74 def tmpdir @tmpdir end |
Class Method Details
.run(recipe_files, backend_type, options) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/itamae/runner.rb', line 7 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
86 87 88 89 90 |
# File 'lib/itamae/runner.rb', line 86 def load_recipes(paths) paths.each do |path| children << Recipe.new(self, File.(path)) end end |
#run(options) ⇒ Object
92 93 94 |
# File 'lib/itamae/runner.rb', line 92 def run() children.run() end |