Sha256: 4a1516182480d2d65bb7626138b85b47a7c6643929ffd0d8603f6a61a7b1f961
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 KB
Contents
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, step, test, privateKey, serverBase, serverNumber) planStep = PlanStep.new puts "Processing configure.json for #{segment} in #{blueprint} from #{@basePath}" instructions = YAML.load_file("#{@basePath}/blueprints/#{blueprint}/instruction.yml") segment = instructions['instructions']['segments'][segment] puts segment['abbreviation'] index = 1 segment['image'].each { |item| if item.start_with?("step:") parts = item.split(':') if (index < Integer(step)) puts "[#{index}] #{item} SKIPPING" else puts "[#{index}] #{item}" if (test == false) publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{serverBase}-#{serverNumber}.json") RemoteRun.new.do publicIp, privateKey, parts[1], parts[2] # Keep track of what we have done; parsing the response and looking at the JSON end end index = index + 1 end } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
canzea-0.1.68 | lib/commands/prepare-plan.rb |
canzea-0.1.67 | lib/commands/prepare-plan.rb |
canzea-0.1.66 | lib/commands/prepare-plan.rb |