canzea 0.1.116 → 0.1.117

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: e31ec0a73c136d5f5f3a6a2d0685cd62cd579725
4
- data.tar.gz: 4c53d8c22247ee5dd1c95a57c71f1053c82e80f5
3
+ metadata.gz: 1ed5bdb75d1ee3d19de31e190f23935b687988f7
4
+ data.tar.gz: 444ae04302c0abffd78b47d4514603a71e2a4b9d
5
5
  SHA512:
6
- metadata.gz: 0fe660ebb8122447618744a9e5bd2181f844f03ed8b4fd73c742f1d122e748e14b34fe7783f71059c9fcb8b42c6601e85400729fd8a6c88d56a17883fd189be8
7
- data.tar.gz: 187107f82e6df2ba58fbda7304aaa7ff111a7d7b715d68e92c161c792a9676841d4bbc30817d43d0c818da7e288308a6e02055bb55cd23b53af795236b34795d
6
+ metadata.gz: 9eddd6bd64c489913895de7effbe7491a685c3691fe17eab14781c212ab445f5b6d18066545fe7480dde6f9504dff07759cee386a997590cf7a36227608a76dc
7
+ data.tar.gz: 7d819a64ee5d214eda994dee8e9cc40b14cebb5e80f0f767c645ee3229197b3f3911bf9925598e09451f97a458e7c70a05a1d3f84b428599055a6b54fb5258c6
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.116"
2
+ VERSION = "0.1.117"
3
3
  end
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)
@@ -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.116
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-26 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler