canzea 0.1.27 → 0.1.28

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: 393b5d9b31d9e343c1005490a883a41d316cf8da
4
- data.tar.gz: c394a1d48509fd257f742d7d80e4e9e5619c31b0
3
+ metadata.gz: 1679fa92754d35e14fac4f8191f373a800b2568a
4
+ data.tar.gz: c9fe74d01589e284d5504a553f418a2c3e575137
5
5
  SHA512:
6
- metadata.gz: 73b57810677334a3b1ad6153d16fd15e4e460901e134a61144445ae5465772ae96665d8c18debccff48ecbac985472315c8bac56fe69dfe46d38a60e92e3951f
7
- data.tar.gz: eedf421864d7fe230ed988fe79b7c61fe7d7b355f619abb9160d4cb1617dfc1d19edcef4c6458ca8b0be9e432faff8a0c71852ad03ab021df3b679fe3cdd6357
6
+ metadata.gz: ab6bba84066ffb4b9130e735c1ce0370dcf14a05ab00ef3421a684d14e170e403fc15e2da8e665dc9a47e1b5c85c9494b9694bca740e92351083ade2c6132cf9
7
+ data.tar.gz: 17f393254f94b4bd7b931185f1d27f9545ac76564cbbe998dda1d36a3a857f4b45efe9db070b3852d114671d260cfdcd262ad6242a5d80f62c3ee1ae9ebcc654
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.27"
2
+ VERSION = "0.1.28"
3
3
  end
data/lib/canzea.rb CHANGED
@@ -14,6 +14,8 @@ require "commands/get-catalog"
14
14
  require "commands/remote-run"
15
15
  require "commands/remote-bootstrap"
16
16
  require "commands/gen-user"
17
+ require "commands/update-config"
18
+ require "commands/apply-config"
17
19
 
18
20
  module Canzea
19
21
 
@@ -86,6 +88,11 @@ module Canzea
86
88
  r = Registry.new
87
89
  puts r.getKeyValue (args[0])
88
90
  end
91
+ if (util == "apply-config")
92
+ gitRoot = opts.fetch(:gitRoot, Canzea::config[:git_repo])
93
+ ac = ApplyConfig.new
94
+ ac.do gitRoot
95
+ end
89
96
  end
90
97
 
91
98
  if (opts[:reset])
@@ -106,8 +113,8 @@ module Canzea
106
113
  gitRoot = opts.fetch(:gitRoot, Canzea::config[:git_repo])
107
114
 
108
115
  conf = { :gitRoot => gitRoot, :role => opts[:role], :solution => opts[:solution] }
109
- ps = HelperRun.new
110
- ps.run "playground", "update-config", JSON.generate(conf)
116
+ ps = UpdateConfig.new
117
+ ps.do opts[:role], opts[:solution], gitRoot
111
118
  end
112
119
  end
113
120
 
@@ -0,0 +1,23 @@
1
+ require 'json'
2
+ require 'plan-step-class'
3
+
4
+ class ApplyConfig
5
+
6
+ def do (gitRoot)
7
+ ps = PlanStep.new
8
+
9
+ # Read the configuration file and make calls out to run
10
+
11
+ puts "Processing #{gitRoot}/configure.json"
12
+ steps = JSON.parse(File.read("#{gitRoot}/configure.json"))
13
+
14
+ steps["steps"].each { | step |
15
+
16
+ role = step['role']
17
+ solution = step['solution']
18
+
19
+ puts "Configure for #{role} and #{solution}"
20
+ ps.runPhaseConfigure role, solution, false, 1
21
+ }
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'json'
2
+
3
+ class UpdateConfig
4
+
5
+ def do (role, solution, gitRoot)
6
+
7
+ steps = {}
8
+
9
+ # write to configure the registration of the service
10
+ if (File.exists?("#{gitRoot}/configure.json"))
11
+ steps = JSON.parse(File.read("#{gitRoot}/configure.json"))
12
+ else
13
+ steps["steps"] = []
14
+ end
15
+
16
+ conf = {
17
+ :role => role,
18
+ :solution => solution
19
+ }
20
+ steps["steps"].push(conf)
21
+
22
+ File.open("#{gitRoot}/configure.json", 'w') { |file| file.puts(JSON.generate(steps)) }
23
+ end
24
+ end
@@ -81,7 +81,7 @@ class PlanStep
81
81
  if (md['services'].size() > 0)
82
82
  svc = md['services'][0]
83
83
  adef = {"listener"=>svc['listener'], "serviceName"=>svc['name'], "tags"=>{}, "port"=>svc['port']}
84
- puts "-- Registering"
84
+ puts "-- Registering #{svc['name']}"
85
85
  if (test == false)
86
86
  h = HelperRun.new
87
87
  h.run "consul", "add_service", JSON.generate(adef)
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.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies
@@ -165,11 +165,13 @@ files:
165
165
  - lib/canzea/config.rb
166
166
  - lib/canzea/environment.rb
167
167
  - lib/canzea/version.rb
168
+ - lib/commands/apply-config.rb
168
169
  - lib/commands/config-git-commit.rb
169
170
  - lib/commands/gen-user.rb
170
171
  - lib/commands/get-catalog.rb
171
172
  - lib/commands/remote-bootstrap.rb
172
173
  - lib/commands/remote-run.rb
174
+ - lib/commands/update-config.rb
173
175
  - lib/helper-run-class.rb
174
176
  - lib/plan-step-class.rb
175
177
  - lib/prepare-environment.rb