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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4552872d9584dc1d8455e4907a0b02145a5c207
4
- data.tar.gz: 6f0790140e14aaeeebf7cb3b0da898ab861b7493
3
+ metadata.gz: d94c94866a7ce75578cb6e85238425f9a19e9160
4
+ data.tar.gz: b5f9af7cb3ff37f433de5a35384f8d5aa6cffa43
5
5
  SHA512:
6
- metadata.gz: f50fd3d5e353eb8b5f60fe7261560e584839e95f9ebfa72228efd63ec21f0f7aa7a8d9c2d9915775d3084cdecdc9bc4c7d7c7f8bd9644b2abeb6f53e0036613e
7
- data.tar.gz: 60ddae33921b4d0dc3bd56ee1709b3fbe3cae6a1c085e5bf47dce0c881345fe6fe2d2de96c81a5bab0ad0ce742a99df39f8d8175126f2d21fc8cd5e203294971
6
+ metadata.gz: 96e272ba25adbf415d83552c3df597bece0d2caaaed923c9e2982c9799e733be9de960184a1efebe975e2524a02b31654eb9342c919ea8ef6a27cc69beb7c23a
7
+ data.tar.gz: 66934fe7d892a651c967009c256dad42726ef49b225a17f04fba751da0b39b407be61df52edbb940883da50923ae29c2184a7e1ae47ff01644ef01727b4083d1
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.56"
2
+ VERSION = "0.1.57"
3
3
  end
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
- puts "[#{index}] Configure for #{role} and #{solution}"
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
- planStep.runPhaseInstall parts[1], parts[2], true, 1
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.56
4
+ version: 0.1.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies