canzea 0.1.167 → 0.1.169

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: cc04e83fa7fed7f2c8aa1bdcd27cea7402ecf5d5
4
- data.tar.gz: 60862ce32ce73ab9a8dacdab3e8591e4eb5b275d
3
+ metadata.gz: edbee97c1b07b60b9997785cfb6e44e03bd6e6d0
4
+ data.tar.gz: 0ee47c5b577630b8865577c78b495068e16d013c
5
5
  SHA512:
6
- metadata.gz: 824d59fe679124f9cfb4f2757ed3920ad9b1625fd045f3a19b71a176b517ad6d1247f731f8ca681738726963a245a73d01f07d9f7ad622bf73c2d60ddca7e916
7
- data.tar.gz: 8ed80993f560b5fbd90e29d080bacfd54a6faab3dccbfc8b18836f6ba96f1dc257edd1e1c8929b717362fc3a1d5be63186b79c5d79d01a8684b2db85ec8fba23
6
+ metadata.gz: ea1e4897f63a6944896959402bde08541dbc061b2d8fddf41889db01a91aed185668809d3c68fb048143b92e5d23ec8b16cbc8677c316988e1bbfdc4b47b8421
7
+ data.tar.gz: 7e64916dfa5ce4da01ef2329b771e36ce1d90518ccc0bb78847378d0f1b4cc774ff01335ad1ef89c98599f4c538136855a7dd6f925ab7cddc4c68f24430a4d2e
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.167"
2
+ VERSION = "0.1.169"
3
3
  end
data/lib/canzea.rb CHANGED
@@ -139,11 +139,27 @@ module Canzea
139
139
  RegisterMetadata.new.do(opts[:role], opts[:solution], test)
140
140
  end
141
141
 
142
+ if (util == "run-command")
143
+ args = JSON.parse(opts.fetch(:args, "{}"))
144
+
145
+ # If there are args, then parse them and put them in environment variables
146
+ args.keys.each { | k |
147
+ if args[k].instance_of? String
148
+ puts "-- SETTING #{k.upcase} = #{args[k].to_str}"
149
+ ENV[k.upcase] = args[k].to_str
150
+ end
151
+ }
152
+
153
+ ps = HelperRun.new opts.fetch(:raw, false)
154
+ ps.runCommand args['cmd']
155
+ end
156
+
142
157
  if (util == "analyze-command")
143
158
  step = Integer(opts.fetch(:step, '0'))
144
159
 
145
160
  list = []
146
161
  args = JSON.parse(opts.fetch(:args, "{'phases'=>['install']}"))
162
+
147
163
  phases = args['phases']
148
164
 
149
165
  publicIp = File.read("#{Canzea::config[:pwd]}/vps-#{opts[:serverBase]}-#{opts[:serverNumber]}.json")
@@ -173,7 +189,11 @@ module Canzea
173
189
  if index >= step
174
190
  puts "[#{index}] #{cmd}"
175
191
 
176
- RemoteRun.new.doCommand publicIp, opts[:privateKey], cmd
192
+ args['cmd'] = cmd
193
+ jsonArgs = args.to_json
194
+ fullCommand = "canzea --util=run-command --args=#{jsonArgs}"
195
+
196
+ RemoteRun.new.doCommand publicIp, opts[:privateKey], fullCommand
177
197
  else
178
198
  puts "[#{index}] SKIP #{cmd}"
179
199
  end
@@ -86,4 +86,21 @@ class HelperRun
86
86
  abort()
87
87
  end
88
88
  end
89
+
90
+ def runCommand (cmd)
91
+
92
+ begin
93
+
94
+ r = RunnerWorker.new @raw
95
+
96
+ r.run cmd, 1, 1, status
97
+
98
+ rescue => exception
99
+ @log.error(cmd)
100
+ @log.error(exception.to_s)
101
+ @log.error(exception.backtrace)
102
+ abort()
103
+ end
104
+ end
105
+
89
106
  end
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.167
4
+ version: 0.1.169
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies