Sha256: 6b6e5b62bd9cc931094fb90aa90525087a21fdbf8cd271cb4cf8aa926a4d745d
Contents?: true
Size: 1.41 KB
Versions: 8
Compression:
Stored size: 1.41 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) 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-DevOps-1.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
8 entries across 8 versions & 1 rubygems