rig 0.6.1 → 0.6.2
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.
- data/CHANGELOG.md +9 -0
- data/lib/rig/command/ssh.rb +23 -0
- data/lib/rig/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.6.2:
|
4
|
+
* add csshx support, just generates and runs the csshx command line to connect to all instances of an environment
|
5
|
+
|
6
|
+
## v0.6.1:
|
7
|
+
* clean up logging
|
8
|
+
* clean up loggers and log handling, still needs some work
|
9
|
+
* add rake development dependency
|
10
|
+
* update changelog task, clean up output.
|
11
|
+
|
3
12
|
## v0.6.0:
|
4
13
|
* add changelog task
|
5
14
|
* fix smarter_templates merge conflict
|
data/lib/rig/command/ssh.rb
CHANGED
@@ -23,6 +23,29 @@ module Rig
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
class Csshx < Abstract
|
28
|
+
option %w{-u --user}, "USER", "the user to login as", :default => (Rig.config[:ssh][:user] rescue nil)
|
29
|
+
option %w{-V --verbose}, :flag, "verbose output (print csshX command)"
|
30
|
+
parameter "ENVIRONMENT", "environment to connect to"
|
31
|
+
def execute
|
32
|
+
unless user
|
33
|
+
puts "must set rig:ssh:user in configuration."
|
34
|
+
exit(1)
|
35
|
+
end
|
36
|
+
|
37
|
+
list = Rig::Model::Instance.find_by_environment(environment)
|
38
|
+
if list.count == 0
|
39
|
+
puts "environment has no servers or not found."
|
40
|
+
else
|
41
|
+
cmd = "csshX --login #{user} "
|
42
|
+
cmd += list.map {|e| "#{e.tags['Name']}.#{Rig.account[:dns_zone]}"}.join(" ")
|
43
|
+
puts "running command: '#{cmd}'" if verbose?
|
44
|
+
exec(cmd)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
26
48
|
end
|
27
49
|
end
|
28
50
|
Rig::Command::Main.subcommand 'ssh', 'ssh to server', Rig::Command::Ssh
|
51
|
+
Rig::Command::Main.subcommand 'csshx', 'csshx to environment', Rig::Command::Csshx
|
data/lib/rig/version.rb
CHANGED