canzea 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/canzea/version.rb +1 -1
- data/lib/canzea.rb +1 -1
- data/lib/commands/apply-config.rb +7 -1
- data/lib/commands/prepare-plan.rb +14 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d94c94866a7ce75578cb6e85238425f9a19e9160
|
4
|
+
data.tar.gz: b5f9af7cb3ff37f433de5a35384f8d5aa6cffa43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e272ba25adbf415d83552c3df597bece0d2caaaed923c9e2982c9799e733be9de960184a1efebe975e2524a02b31654eb9342c919ea8ef6a27cc69beb7c23a
|
7
|
+
data.tar.gz: 66934fe7d892a651c967009c256dad42726ef49b225a17f04fba751da0b39b407be61df52edbb940883da50923ae29c2184a7e1ae47ff01644ef01727b4083d1
|
data/lib/canzea/version.rb
CHANGED
data/lib/canzea.rb
CHANGED
@@ -115,7 +115,7 @@ module Canzea
|
|
115
115
|
end
|
116
116
|
if (util == "prepare-plan")
|
117
117
|
ac = PreparePlan.new
|
118
|
-
ac.do opts[:blueprint], opts[:segment]
|
118
|
+
ac.do opts[:blueprint], opts[:segment], opts[:step], test, opts[:privateKey]
|
119
119
|
end
|
120
120
|
if (util == "apply-config")
|
121
121
|
gitRoot = opts.fetch(:gitRoot, Canzea::config[:git_repo])
|
@@ -3,12 +3,16 @@ require 'commands/add-env'
|
|
3
3
|
require 'plan-step-class'
|
4
4
|
|
5
5
|
class ApplyConfig
|
6
|
+
def initialize ()
|
7
|
+
@log = Logger.new(Canzea::config[:logging_root] + '/plans.log')
|
8
|
+
end
|
6
9
|
|
7
10
|
def do (gitRoot, test = false, stepNum = nil, task = nil)
|
8
11
|
ps = PlanStep.new
|
9
12
|
|
10
13
|
# Read the configuration file and make calls out to run
|
11
14
|
|
15
|
+
@log.info("Processing #{gitRoot}/configure.json")
|
12
16
|
puts "Processing #{gitRoot}/configure.json"
|
13
17
|
steps = JSON.parse(File.read("#{gitRoot}/configure.json"))
|
14
18
|
|
@@ -21,9 +25,11 @@ class ApplyConfig
|
|
21
25
|
solution = step['solution']
|
22
26
|
puts "#{stepNum} and #{index}"
|
23
27
|
if (stepNum == nil or index >= Integer(stepNum))
|
24
|
-
|
28
|
+
@log.info "[#{index}] Configure for #{role} and #{solution}"
|
25
29
|
ps.runPhaseConfigure role, solution, test, (task == nil ? 1:task)
|
26
30
|
task = 1
|
31
|
+
else
|
32
|
+
@log.info "[#{index}] Configure for #{role} and #{solution} SKIP"
|
27
33
|
end
|
28
34
|
index = index + 1
|
29
35
|
}
|
@@ -10,22 +10,32 @@ class PreparePlan
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# Read the blueprint instructions and prepare plan for a particular segment
|
13
|
-
def do (blueprint, segment)
|
13
|
+
def do (blueprint, segment, step, test, privateKey)
|
14
14
|
planStep = PlanStep.new
|
15
15
|
|
16
|
-
puts "Processing configure.json for #{segment} in #{blueprint}"
|
16
|
+
puts "Processing configure.json for #{segment} in #{blueprint} from #{@basePath}"
|
17
17
|
|
18
18
|
instructions = YAML.load_file("#{@basePath}/blueprints/#{blueprint}/instruction.yml")
|
19
19
|
segment = instructions['instructions']['segments'][segment]
|
20
20
|
|
21
21
|
puts segment['abbreviation']
|
22
22
|
|
23
|
+
index = 1
|
23
24
|
segment['image'].each { |item|
|
24
25
|
if item.start_with?("step:")
|
25
|
-
puts item
|
26
26
|
parts = item.split(':')
|
27
27
|
|
28
|
-
|
28
|
+
if (index < Integer(step))
|
29
|
+
puts "[#{index}] #{item} SKIPPING"
|
30
|
+
else
|
31
|
+
puts "[#{index}] #{item}"
|
32
|
+
if (test == false)
|
33
|
+
publicIp = File.read("#{Canzea::config[:pwd]}/vps-DevOps-1.json")
|
34
|
+
RemoteRun.new.do publicIp, privateKey, parts[1], parts[2]
|
35
|
+
# Keep track of what we have done; parsing the response and looking at the JSON
|
36
|
+
end
|
37
|
+
end
|
38
|
+
index = index + 1
|
29
39
|
end
|
30
40
|
}
|
31
41
|
end
|