Class: ItamaeSpec::Task::LocalItamaeTask

Inherits:
BaseTask
  • Object
show all
Defined in:
lib/itamae-spec/task/local_itamae_task.rb

Constant Summary

Constants inherited from BaseTask

BaseTask::LoadAttributeError, BaseTask::LoadRecipeError

Constants included from Base

Base::EnvironmentsLoadError, Base::RoleLoadError

Instance Method Summary collapse

Methods inherited from BaseTask

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

Methods included from Base

get_environments, get_node_recipes, get_role_recipes, get_roles, write_tmp_nodes

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-spec/task/local_itamae_task.rb', line 6

def create_itamae_command(node_name, hash)
  command = 'bundle exec itamae-spec 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