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.
@@ -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
@@ -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
@@ -3,7 +3,7 @@ unless defined?(Rig::Version)
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 6
6
- TINY = 1
6
+ TINY = 2
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: