gaptool-client 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gaptool-client.rb +9 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5171b7f54152ead4a6a69e8d4acb688a29058fb2
4
- data.tar.gz: d65de735f7f0fc77b95660a5a0463d68ff6a43ee
3
+ metadata.gz: 3da4994e4b825bcc5b7bfc1ad27a1215d53d47ac
4
+ data.tar.gz: 054d299381cf81407112b4fc917c79bef461607e
5
5
  SHA512:
6
- metadata.gz: 730fb990f7335c8992c84187d9e9a2a9c0c4060e37e3ed7795fff96f3c1d81b557735b20274ed35c0a1fddaf095e6941b80044a5bb815872b157f755a6f657b1
7
- data.tar.gz: 8c15765196815ce6727350ff45f90bcdbde1b48df5dfd02f0106e7ade0d6b70505669fc627f952c5f7a07a3e769365539bc0af78b8ef7752098ac0d5f9467da5
6
+ metadata.gz: 7642255520b648d898e30dbe08e1bdd56d30c91c949d7cab231c0d889540180e5ae7d18e16b7747628dd5f1d359e562a51d486d02f4de7825348c1e3dd2d312a
7
+ data.tar.gz: e75326916ea065209421f4c3452785251ab7866389c309d9b339db2ccb1b1b48dfb3fec953b8e5df669948aad3c750aee560a845bd7937cf689179e36cb97c70
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.3
1
+ 0.7.4
@@ -150,15 +150,16 @@ module Gaptool
150
150
  option ["-r", "--role"], "ROLE", "Role name to ssh to", :required => true
151
151
  option ["-e", "--environment"], "ENVIRONMENT", "Which environment, e.g. production", :required => true
152
152
  option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => false
153
+ option ['-s', '--serial'], :flag, 'Run command serially. Order of execution is unknown.'
153
154
  parameter "COMMAND ...", "Command to run", :attribute_name => :command
154
155
  def execute
155
156
  if !instance.nil?
156
- node = $api.getonenode(instance)
157
157
  nodes = [$api.getonenode(instance)]
158
158
  else
159
159
  nodes = $api.getenvroles(role, environment)
160
160
  end
161
- nodes.peach do |node|
161
+ method = serial? ? :each : :peach
162
+ nodes.send method do |node|
162
163
  commands = [ command.join(' ') ]
163
164
  sshcmd(node, commands)
164
165
  end
@@ -270,6 +271,7 @@ module Gaptool
270
271
  option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => false
271
272
  option ["-A", "--attribute"], "ATTRIBUTE", "Pass one or more parameters to the deploy recipe in recipe.attr=value format", :multivalued => true
272
273
  option ["-b", "--chef-branch"], "BRANCH", "branch of the chef repository to use (defaults to last branch used during init/chefrun)", :default => nil
274
+ option ['-s', '--serial'], :flag, 'Run command serially. Order of execution is unknown.'
273
275
 
274
276
  def execute
275
277
  attrs = split_attrs(attribute_list)
@@ -278,7 +280,8 @@ module Gaptool
278
280
  else
279
281
  nodes = $api.getenvroles(role, environment)
280
282
  end
281
- nodes.peach do |node|
283
+ method = serial? ? :each : :peach
284
+ nodes.send method do |node|
282
285
  if node['chef_runlist'].nil?
283
286
  runlist = ['recipe[main]']
284
287
  elsif node['chef_runlist'].is_a? Array
@@ -323,6 +326,7 @@ module Gaptool
323
326
  option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678. If set, all applications MUST be hosted on this node.", :required => false
324
327
  option ["-A", "--attribute"], "ATTRIBUTE", "Pass one or more parameters to the deploy recipe in recipe.attr=value format", :multivalued => true
325
328
  option ['-H', '--hidden'], :flag, 'Display hidden hosts'
329
+ option ['-s', '--serial'], :flag, 'Run command serially. Order of execution is unknown.'
326
330
 
327
331
  def execute
328
332
  attrs = split_attrs(attribute_list)
@@ -360,7 +364,8 @@ module Gaptool
360
364
  x
361
365
  end
362
366
 
363
- nodes.peach do |node|
367
+ method = serial? ? :each : :peach
368
+ nodes.send method do |node|
364
369
  host = "#{node['role']}:#{node['environment']}:#{node['instance']}"
365
370
  puts "#{Rainbow("Deploying apps").cyan} '" + \
366
371
  Rainbow(node['apps_to_deploy'].join(" ")).green + \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaptool-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Laurita
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-08 00:00:00.000000000 Z
13
+ date: 2015-06-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json