Class: ItamaeMitsurin::Mitsurin::LocalTask

Inherits:
BaseTask
  • Object
show all
Defined in:
lib/itamae-mitsurin/mitsurin/local_task.rb

Constant Summary

Constants inherited from BaseTask

BaseTask::EnvironmentsSetError, BaseTask::LoadAttributeError, BaseTask::LoadRecipeError

Instance Method Summary collapse

Methods inherited from BaseTask

#create_spec_command, #create_tmp_nodes, #list_recipe_filepath, #load_environments, #load_node_attributes, #load_recipe_attributes, #load_run_list, #merge_attributes, #runner_display

Instance Method Details

#create_itamae_command(node_name, hash) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/itamae-mitsurin/mitsurin/local_task.rb', line 6

def create_itamae_command(node_name, hash)
  command = 'bundle exec itamae local'
  command << " -j tmp-nodes/#{node_name}.json"

  hash[:environments][:shell] = ENV['shell'] if ENV['shell']
  command << if hash[:environments][:shell]
               " --shell=#{hash[:environments][:shell]}"
             else
               ' --shell=bash'
             end

  command << ' --dry-run' if ENV['dry-run'] == 'true'
  command << ' --log-level=debug' if ENV['debug'] == 'true'
  command
end