canzea 0.1.116 → 0.1.117
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canzea/version.rb +1 -1
- data/lib/canzea.rb +6 -0
- data/lib/plan-step-class.rb +53 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ed5bdb75d1ee3d19de31e190f23935b687988f7
|
4
|
+
data.tar.gz: 444ae04302c0abffd78b47d4514603a71e2a4b9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eddd6bd64c489913895de7effbe7491a685c3691fe17eab14781c212ab445f5b6d18066545fe7480dde6f9504dff07759cee386a997590cf7a36227608a76dc
|
7
|
+
data.tar.gz: 7d819a64ee5d214eda994dee8e9cc40b14cebb5e80f0f767c645ee3229197b3f3911bf9925598e09451f97a458e7c70a05a1d3f84b428599055a6b54fb5258c6
|
data/lib/canzea/version.rb
CHANGED
data/lib/canzea.rb
CHANGED
@@ -204,6 +204,12 @@ module Canzea
|
|
204
204
|
ps.runPhaseConfigure opts[:role], opts[:solution], test, Integer(opts.fetch(:task, 1))
|
205
205
|
end
|
206
206
|
|
207
|
+
if lifecycle == 'patch'
|
208
|
+
puts "-- Running patch step #{opts[:role]} #{opts[:solution]}"
|
209
|
+
ps = PlanStep.new
|
210
|
+
ps.runPhasePatch opts[:role], opts[:solution], test, Integer(opts.fetch(:task, 1))
|
211
|
+
end
|
212
|
+
|
207
213
|
if lifecycle == 'wire'
|
208
214
|
# puts "-- Running helper #{opts[:solution]} #{opts[:action]}"
|
209
215
|
ps = HelperRun.new opts.fetch(:raw, false)
|
data/lib/plan-step-class.rb
CHANGED
@@ -133,6 +133,59 @@ class PlanStep
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
+
|
137
|
+
def runPhasePatch (role, solution, test, task, ref="")
|
138
|
+
|
139
|
+
plan = JSON.parse("{ \"plan\": [ { \"role\": \"#{role}\", \"solution\": \"#{solution}\" } ] }")
|
140
|
+
|
141
|
+
ENV['ES_REF'] = ref;
|
142
|
+
ENV['ES_ROLE'] = role;
|
143
|
+
ENV['ES_SOLUTION'] = solution;
|
144
|
+
|
145
|
+
n = Worker.new
|
146
|
+
n.test ( test )
|
147
|
+
|
148
|
+
start = Integer(task)
|
149
|
+
lines = 1
|
150
|
+
|
151
|
+
cmd = "undefined"
|
152
|
+
|
153
|
+
commit = ENV['CATALOG_COMMIT']
|
154
|
+
|
155
|
+
# patches/<commit>/role/solution
|
156
|
+
begin
|
157
|
+
|
158
|
+
plan['plan'].each do |item|
|
159
|
+
|
160
|
+
root = "#{@basePath}/#{commit}/#{item['role']}/#{item['solution']}"
|
161
|
+
if File.exist?(root) == false
|
162
|
+
log "-- WARNING #{root} does not exist"
|
163
|
+
else
|
164
|
+
|
165
|
+
if (test == false)
|
166
|
+
|
167
|
+
envScript = "#{root}/environment.json"
|
168
|
+
if File.exist?(envScript)
|
169
|
+
envPush = PrepareEnvironment.new false
|
170
|
+
envPush.addToEnv "#{envScript}"
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
|
175
|
+
cmd = "#{root}/patch.sh"
|
176
|
+
if File.exist?(cmd)
|
177
|
+
lines = n.run cmd, start, lines - 1, false, ref
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
rescue => exception
|
182
|
+
@log.error(cmd)
|
183
|
+
@log.error(exception.to_s)
|
184
|
+
@log.error(exception.backtrace)
|
185
|
+
abort()
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
136
189
|
def log (msg)
|
137
190
|
puts msg
|
138
191
|
@log.info(msg)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.117
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Canzea Technologies
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|