gaptool-client 0.7.3 → 0.7.4
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 +4 -4
- data/VERSION +1 -1
- data/lib/gaptool-client.rb +9 -4
- 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: 3da4994e4b825bcc5b7bfc1ad27a1215d53d47ac
|
|
4
|
+
data.tar.gz: 054d299381cf81407112b4fc917c79bef461607e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7642255520b648d898e30dbe08e1bdd56d30c91c949d7cab231c0d889540180e5ae7d18e16b7747628dd5f1d359e562a51d486d02f4de7825348c1e3dd2d312a
|
|
7
|
+
data.tar.gz: e75326916ea065209421f4c3452785251ab7866389c309d9b339db2ccb1b1b48dfb3fec953b8e5df669948aad3c750aee560a845bd7937cf689179e36cb97c70
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.4
|
data/lib/gaptool-client.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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-
|
|
13
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: json
|