gaptool-client 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gaptool-client.gemspec +2 -2
- data/lib/gaptool-client.rb +19 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/gaptool-client.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "gaptool-client"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Bailey"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-07-23"
|
13
13
|
s.description = "client for gaptool-server"
|
14
14
|
s.email = "m@mdb.io"
|
15
15
|
s.executables = ["gt"]
|
data/lib/gaptool-client.rb
CHANGED
@@ -102,6 +102,24 @@ module Gaptool
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
class RuncmdCommand < Clamp::Command
|
106
|
+
option ["-r", "--role"], "ROLE", "Role name to ssh to", :required => true
|
107
|
+
option ["-e", "--environment"], "ENVIRONMENT", "Which environment, e.g. production", :required => true
|
108
|
+
option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => false
|
109
|
+
option ["-c", "--command"], "COMMAND", "Command to run", :required => true
|
110
|
+
def execute
|
111
|
+
if !instance.nil?
|
112
|
+
nodes = [$api.getonenode(instance)]
|
113
|
+
else
|
114
|
+
nodes = $api.getenvroles(role, environment)
|
115
|
+
end
|
116
|
+
nodes.peach do |node|
|
117
|
+
commands = [ command ]
|
118
|
+
sshcmd(node, commands)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
105
123
|
class SshCommand < Clamp::Command
|
106
124
|
option ["-r", "--role"], "ROLE", "Role name to ssh to", :required => true
|
107
125
|
option ["-e", "--environment"], "ENVIRONMENT", "Which environment, e.g. production", :required => true
|
@@ -364,6 +382,7 @@ module Gaptool
|
|
364
382
|
subcommand "services", "show all services", ServicesCommand
|
365
383
|
subcommand "svcapi", "manipulate service API keys/metadata", SvcAPI
|
366
384
|
subcommand "rehash", "Regenerate all host metadata. KNOW WHAT THIS DOES BEFORE RUNNING IT", RehashCommand
|
385
|
+
subcommand "runcmd", "Run command on instance", RuncmdCommand
|
367
386
|
|
368
387
|
end
|
369
388
|
end
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
255
|
version: '0'
|
256
256
|
segments:
|
257
257
|
- 0
|
258
|
-
hash:
|
258
|
+
hash: 4212926070010481604
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
none: false
|
261
261
|
requirements:
|