require 'json' require 'commands/add-env' require 'plan-step-class' require 'yaml' require 'canzea/config' class PreparePlan def initialize () @basePath = "#{Pathname.new(Canzea::config[:catalog_location]).realpath}/catalog" end # Read the blueprint instructions and prepare plan for a particular segment def do (blueprint, segment) planStep = PlanStep.new puts "Processing configure.json for #{segment} in #{blueprint}" instructions = YAML.load_file("#{@basePath}/blueprints/#{blueprint}/instruction.yml") segment = instructions['instructions']['segments'][segment] puts segment['abbreviation'] segment['image'].each { |item| if item.start_with?("step:") puts item parts = item.split(':') planStep.runPhaseInstall parts[1], parts[2], true, 1 end } end end