bcome 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01324b7764e93f79ce32699d34d94965d415cebe
4
- data.tar.gz: 83ec2d6950806c8296dcbb7973ade7b2f67b7e6e
3
+ metadata.gz: 014cefb974e62be9d8a7f59c5b3712375a58fdfc
4
+ data.tar.gz: cf0d5ca26ed706988090518fdc0a11a9a0bf9f8a
5
5
  SHA512:
6
- metadata.gz: ee0d1b667b905e6707fb63cd9597ecc68d8dc53544609a05236e3486d87ad500611d13ac9399ede75ecf5e84984c00ec245a5b1962b2a548b5bd457c2101ba5c
7
- data.tar.gz: 6ce03cf191a70e15bb9f112f4928a2fcd5a36908f36c70ece2c1144dcf489fea792708f2c3dcf155da430312fa66c42603eea6926b73dbf5bb3e9e5081642d7e
6
+ metadata.gz: 075d3d930d562803e00ff424009421e9b2536f33ff8f774e7a5deb41dc1fc28d53d32d3fcba3354666c78c770ea90916b37cc421c61ba553ca37325d70461e37
7
+ data.tar.gz: d6d8baa2cf39f2c7ea621e210371c883d5f4725c99dc65aea3b4c4266783330d21a9789f2db94b00ef2ca6cc253ea6443c38ec184e77d178d20404dd42697328
@@ -1,5 +1,7 @@
1
1
  # External Usage
2
2
 
3
+ ## Scripting
4
+
3
5
  Bcome may be used for scripting outside of the bcome shell.
4
6
 
5
7
  This allows for integration with tools such as Capistrano, or for any ad-hoc scripting need.
@@ -29,3 +31,16 @@ see documentation/example_non_shell_scripts/examples_script_platform_level.rb
29
31
  ### Interacting with your entire estate
30
32
 
31
33
  see documentation/example_non_shell_scripts/examples_script_entire_estate.rb
34
+
35
+ ## Direct SSH to nodes
36
+
37
+ If you know the context breadcrumb for a node, you may use the bcome gem to SSH to it directly without accessing the node via the bcome shell.
38
+
39
+ ```
40
+
41
+ > bcome platform:environment:instancename:ssh
42
+ e.g.
43
+ > bcome myplatformname:production:appserver1:ssh
44
+
45
+ ```
46
+
@@ -4,6 +4,7 @@ require 'net/scp'
4
4
  require 'net/ssh/proxy/command'
5
5
  require 'fog'
6
6
  require 'require_all'
7
+ require 'parallel'
7
8
 
8
9
  require_all "#{File.dirname(__FILE__)}/../lib"
9
10
  require_all "#{File.dirname(__FILE__)}/../filters"
@@ -1,3 +1,3 @@
1
1
  module Bcome
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -17,7 +17,7 @@ class ::Bcome::Command
17
17
  end
18
18
 
19
19
  def pretty_result
20
- return is_success? ? "Success".success : "Failed".failure
20
+ return is_success? ? "success".success : "failure".failure
21
21
  end
22
22
 
23
23
  def ssh_user
@@ -38,7 +38,7 @@ class ::Bcome::Command
38
38
 
39
39
  def output
40
40
  command_output = is_success? ? @stdout : "Exit code: #{@exit_code}\n\nSTDERR: #{@stderr}"
41
- return "\n#{command_output}\n"
41
+ return "\n#{command_output}"
42
42
  end
43
43
 
44
44
  def is_success?
@@ -24,7 +24,7 @@ module Bcome::Functions
24
24
  else
25
25
  command = cmd_for_ref(reference)
26
26
  if command
27
- puts "#{"Executing command '#{command[:ref]}': ".informational} > #{command[:command].command}"
27
+ #puts "#{"Executing command '#{command[:ref]}': ".informational} > #{command[:command].command}"
28
28
  puts run command[:command]
29
29
  end
30
30
  end
@@ -16,9 +16,11 @@ module Bcome::Selections
16
16
  ## Runs commands over *every* object in the selection
17
17
  def run(raw_commands, bootstrap = false)
18
18
  return unless @objects
19
- @objects.each do |object|
19
+
20
+ Parallel.map(@objects) do |object|
20
21
  object.run(raw_commands, bootstrap)
21
22
  end
23
+
22
24
  return
23
25
  end
24
26
 
data/lib/ssh.rb CHANGED
@@ -6,6 +6,14 @@ class ::Bcome::Ssh
6
6
  @commands = commands
7
7
  end
8
8
 
9
+ def output_append(output_string)
10
+ @output_string = "#{@output_string}#{output_string}"
11
+ end
12
+
13
+ def print_output
14
+ print "#{@output_string}\n"
15
+ end
16
+
9
17
  def execute!
10
18
  @commands.each do |command|
11
19
  instance = command.instance
@@ -14,13 +22,12 @@ class ::Bcome::Ssh
14
22
  proxy = command.proxy
15
23
 
16
24
  ::Net::SSH.start(instance.ip_address, ssh_user, :proxy => proxy, :keys => ssh_keys, :paranoid => false) do |ssh|
17
- puts "(#{instance.identifier})$".cyan + "\s#{command.command}"
18
25
  ssh_exec!(ssh, command)
19
- puts command.output
20
- print command.pretty_result
21
- print "\n"
26
+ output_append("(#{instance.identifier})$".cyan + ">\s#{command.command} (#{command.pretty_result})\n")
27
+ output_append("#{command.output}")
22
28
  ssh.close
23
29
  end
30
+ print_output
24
31
  end
25
32
  end
26
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Roderick (Webzakimbo)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
102
  version: 1.3.3
103
+ - !ruby/object:Gem::Dependency
104
+ name: parallel
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.8.0
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '='
115
+ - !ruby/object:Gem::Version
116
+ version: 1.8.0
103
117
  description: Provides a console interface for traversing a hierarchy of platforms
104
118
  -> environment -> servers, and exposes common administration tools for the managemenent
105
119
  either of individual servers, or groups or servers. System is driven from simple