canzea 0.1.165 → 0.1.166
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 +21 -1
- data/lib/commands/remote-run.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d3ac0cc571245b20ce0cc255de7a3a5f100e15
|
4
|
+
data.tar.gz: fec26f1eb6912fdfa9b46cf5a4779879988d48e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1648f06108685edea2773bcbae876d93b428cb53418ac19291a3d0dcfd92efb8762fb5718be871b77d83e2f5afbf656b033f3d1f27b6bc46885d4e4a2d86aed6
|
7
|
+
data.tar.gz: 4707df9acf4578dbea06d1416deb5ac33ec338dfa51b10f51ef398b49bbe9a6c5d1fa6898f7b4030b76985b59748246fd572d98f9c6b223958d61b1c426c79f9
|
data/lib/canzea/version.rb
CHANGED
data/lib/canzea.rb
CHANGED
@@ -246,6 +246,16 @@ module Canzea
|
|
246
246
|
|
247
247
|
if lifecycle == 'install'
|
248
248
|
puts "-- Running install step #{opts[:role]} #{opts[:solution]}"
|
249
|
+
|
250
|
+
# If there are args, then parse them and put them in environment variables
|
251
|
+
args = JSON.parse(opts.fetch(:args, {}))
|
252
|
+
args.keys.each { | k |
|
253
|
+
if args[k].instance_of? String
|
254
|
+
puts "-- SETTING #{k.upcase} = #{args[k].to_str}"
|
255
|
+
ENV[k.upcase] = args[k].to_str
|
256
|
+
end
|
257
|
+
}
|
258
|
+
|
249
259
|
ps = PlanStep.new
|
250
260
|
ps.runPhaseInstall opts[:role], opts[:solution], test, Integer(opts.fetch(:task, 1))
|
251
261
|
|
@@ -261,6 +271,16 @@ module Canzea
|
|
261
271
|
|
262
272
|
if lifecycle == 'configure'
|
263
273
|
puts "-- Running configure step #{opts[:role]} #{opts[:solution]}"
|
274
|
+
|
275
|
+
# If there are args, then parse them and put them in environment variables
|
276
|
+
args = JSON.parse(opts.fetch(:args, {}))
|
277
|
+
args.keys.each { | k |
|
278
|
+
if args[k].instance_of? String
|
279
|
+
puts "-- SETTING #{k.upcase} = #{args[k].to_str}"
|
280
|
+
ENV[k.upcase] = args[k].to_str
|
281
|
+
end
|
282
|
+
}
|
283
|
+
|
264
284
|
ps = PlanStep.new
|
265
285
|
ps.runPhaseConfigure opts[:role], opts[:solution], test, Integer(opts.fetch(:task, 1))
|
266
286
|
end
|
@@ -287,7 +307,7 @@ module Canzea
|
|
287
307
|
if opts[:remote]
|
288
308
|
publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{opts[:serverBase]}-#{opts[:serverNumber]}.json")
|
289
309
|
publicIp.strip!
|
290
|
-
RemoteRun.new.
|
310
|
+
RemoteRun.new.doInstall publicIp, opts[:privateKey], opts[:role], opts[:solution], opts.fetch(:args, '{}')
|
291
311
|
end
|
292
312
|
|
293
313
|
if opts[:remote_configure]
|
data/lib/commands/remote-run.rb
CHANGED
@@ -15,6 +15,11 @@ class RemoteRun
|
|
15
15
|
remote.exec publicIp, privateKey, "canzea --lifecycle=install --role=#{role} --task=#{task} --solution=#{solution}", ref
|
16
16
|
end
|
17
17
|
|
18
|
+
def doInstall(publicIp, privateKey, role, solution, args, ref="")
|
19
|
+
remote = RemoteCall.new
|
20
|
+
remote.exec publicIp, privateKey, "canzea --lifecycle=install --role=#{role} --solution=#{solution} --args='#{args}'", ref
|
21
|
+
end
|
22
|
+
|
18
23
|
def do(publicIp, privateKey, role, solution, ref="")
|
19
24
|
remote = RemoteCall.new
|
20
25
|
remote.exec publicIp, privateKey, "canzea --lifecycle=install --role=#{role} --solution=#{solution}", ref
|