Sha256: 0bf869a7ececf1271b3351dbaa207ff6e6dddb9cda155ed58a05205aa21553dc

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

require 'json'
require 'commands/add-env'
require 'plan-step-class'

class ApplyConfig

    def do (gitRoot, test = false, stepNum = nil, task = nil)
        ps = PlanStep.new

        # Read the configuration file and make calls out to run

        puts "Processing #{gitRoot}/configure.json"
        steps = JSON.parse(File.read("#{gitRoot}/configure.json"))

        index = 1
        steps["steps"].each { | step |

            AddEnv.new.injectEnvironmentVariables()

            role = step['role']
            solution = step['solution']
            puts "#{stepNum} and #{index}"
            if (stepNum == nil or index >= Integer(stepNum))
                puts "[#{index}] Configure for #{role} and #{solution}"
                ps.runPhaseConfigure role, solution, test, (task == nil ? 1:task)
                task = 1
            end
            index = index + 1
        }
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
canzea-0.1.56 lib/commands/apply-config.rb
canzea-0.1.55 lib/commands/apply-config.rb