canzea 0.1.28 → 0.1.29

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: 1679fa92754d35e14fac4f8191f373a800b2568a
4
- data.tar.gz: c9fe74d01589e284d5504a553f418a2c3e575137
3
+ metadata.gz: da9504124bf52bfa8795481791fc25d36b5c4f66
4
+ data.tar.gz: c666e1c41850f1b425dc0228ee210174ee9348c8
5
5
  SHA512:
6
- metadata.gz: ab6bba84066ffb4b9130e735c1ce0370dcf14a05ab00ef3421a684d14e170e403fc15e2da8e665dc9a47e1b5c85c9494b9694bca740e92351083ade2c6132cf9
7
- data.tar.gz: 17f393254f94b4bd7b931185f1d27f9545ac76564cbbe998dda1d36a3a857f4b45efe9db070b3852d114671d260cfdcd262ad6242a5d80f62c3ee1ae9ebcc654
6
+ metadata.gz: 0600a59bd95f444939beb3a20361f7675bfba60fc2c4c4770436df80271194ccd2fd71e471860448f39f843218fdeef9d66734abbcdc01fc40e87f1e949019ca
7
+ data.tar.gz: 18d65b123e274eb84f5570b476b41c5ef2fcadf9010f507cb19757cc67f95fd0871839edc0657cf2c0ade9c45aa3b39af5d3a201daefa8a9e06ccb67c2af0cac
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.28"
2
+ VERSION = "0.1.29"
3
3
  end
data/lib/canzea.rb CHANGED
@@ -56,6 +56,7 @@ module Canzea
56
56
  option nil, :role, 'Role', argument: :required
57
57
  option nil, :solution, 'Solution', argument: :required
58
58
  option nil, :task, 'Task', argument: :required
59
+ option nil, :step, 'Step', argument: :required
59
60
  option nil, :serverBase, 'Server Base', argument: :required
60
61
  option nil, :serverNumber, 'Server Number', argument: :required
61
62
  option nil, :privateKey, 'Task', argument: :required
@@ -91,7 +92,7 @@ module Canzea
91
92
  if (util == "apply-config")
92
93
  gitRoot = opts.fetch(:gitRoot, Canzea::config[:git_repo])
93
94
  ac = ApplyConfig.new
94
- ac.do gitRoot
95
+ ac.do gitRoot, test, opts[:step], opts[:task]
95
96
  end
96
97
  end
97
98
 
@@ -3,7 +3,7 @@ require 'plan-step-class'
3
3
 
4
4
  class ApplyConfig
5
5
 
6
- def do (gitRoot)
6
+ def do (gitRoot, test = false, stepNum = nil, task = nil)
7
7
  ps = PlanStep.new
8
8
 
9
9
  # Read the configuration file and make calls out to run
@@ -11,13 +11,18 @@ class ApplyConfig
11
11
  puts "Processing #{gitRoot}/configure.json"
12
12
  steps = JSON.parse(File.read("#{gitRoot}/configure.json"))
13
13
 
14
+ index = 1
14
15
  steps["steps"].each { | step |
15
16
 
16
17
  role = step['role']
17
18
  solution = step['solution']
18
-
19
- puts "Configure for #{role} and #{solution}"
20
- ps.runPhaseConfigure role, solution, false, 1
19
+ puts "#{stepNum} and #{index}"
20
+ if (stepNum == nil or Integer(stepNum) == index)
21
+ puts "[#{index}] Configure for #{role} and #{solution}"
22
+ ps.runPhaseConfigure role, solution, test, (task == nil ? 1:task)
23
+ task = 1
24
+ end
25
+ index = index + 1
21
26
  }
22
27
  end
23
28
  end
@@ -72,27 +72,29 @@ class PlanStep
72
72
  raise "#{root} does not exist!"
73
73
  end
74
74
 
75
- # Register the service with Consul, if consul is ready
76
- # If metadata.json exists, then use the information to register
77
- cmd = "#{@basePath}/roles/#{item['role']}/#{item['solution']}/metadata.json"
78
- if File.exist?(cmd)
79
- md = File.read(cmd)
80
- md = JSON.parse(md)
81
- if (md['services'].size() > 0)
82
- svc = md['services'][0]
83
- adef = {"listener"=>svc['listener'], "serviceName"=>svc['name'], "tags"=>{}, "port"=>svc['port']}
84
- puts "-- Registering #{svc['name']}"
85
- if (test == false)
86
- h = HelperRun.new
87
- h.run "consul", "add_service", JSON.generate(adef)
75
+ if (test == false)
76
+ # Register the service with Consul, if consul is ready
77
+ # If metadata.json exists, then use the information to register
78
+ cmd = "#{@basePath}/roles/#{item['role']}/#{item['solution']}/metadata.json"
79
+ if File.exist?(cmd)
80
+ md = File.read(cmd)
81
+ md = JSON.parse(md)
82
+ if (md['services'].size() > 0)
83
+ svc = md['services'][0]
84
+ adef = {"listener"=>svc['listener'], "serviceName"=>svc['name'], "tags"=>{}, "port"=>svc['port']}
85
+ puts "-- Registering #{svc['name']}"
86
+ if (test == false)
87
+ h = HelperRun.new
88
+ h.run "consul", "add_service", JSON.generate(adef)
89
+ end
88
90
  end
89
91
  end
90
- end
91
92
 
92
- envScript = "#{@basePath}/roles/#{item['role']}/#{item['solution']}/environment.json"
93
- if File.exist?(envScript)
94
- envPush = PrepareEnvironment.new
95
- envPush.addToEnv "#{envScript}"
93
+ envScript = "#{@basePath}/roles/#{item['role']}/#{item['solution']}/environment.json"
94
+ if File.exist?(envScript)
95
+ envPush = PrepareEnvironment.new
96
+ envPush.addToEnv "#{envScript}"
97
+ end
96
98
  end
97
99
 
98
100
  cmd = "#{@basePath}/roles/#{item['role']}/#{item['solution']}/configure.sh"
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.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies