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 +4 -4
- data/lib/canzea/version.rb +1 -1
- data/lib/canzea.rb +9 -2
- data/lib/commands/apply-config.rb +23 -0
- data/lib/commands/update-config.rb +24 -0
- data/lib/plan-step-class.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1679fa92754d35e14fac4f8191f373a800b2568a
|
4
|
+
data.tar.gz: c9fe74d01589e284d5504a553f418a2c3e575137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab6bba84066ffb4b9130e735c1ce0370dcf14a05ab00ef3421a684d14e170e403fc15e2da8e665dc9a47e1b5c85c9494b9694bca740e92351083ade2c6132cf9
|
7
|
+
data.tar.gz: 17f393254f94b4bd7b931185f1d27f9545ac76564cbbe998dda1d36a3a857f4b45efe9db070b3852d114671d260cfdcd262ad6242a5d80f62c3ee1ae9ebcc654
|
data/lib/canzea/version.rb
CHANGED
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 =
|
110
|
-
ps.
|
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
|
data/lib/plan-step-class.rb
CHANGED
@@ -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.
|
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
|