phase 0.0.4 → 0.0.5

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: eb2f988f05568590899c7ae5f3d4455c775af120
4
- data.tar.gz: 1f04b470293e4276ee7f3583ca8346d57bd00769
3
+ metadata.gz: cd754d7a55b13fc301cbf943586379f608d148e4
4
+ data.tar.gz: 681b6d02ee212ba1c8c45dcf98f22cfc62bdfc36
5
5
  SHA512:
6
- metadata.gz: 74f5bf568f42b2f10abc042a06493cfc965d0266562142ec027f865e8ed06bd3509c37b50bd4f5e5c77032824c2b17b61258143e382882f13a2cdf30de342428
7
- data.tar.gz: 4611698b760898ee8e8589b0c7ec00fc1a872433426122f4d22a2c864d9da6d80c49cb4d2c7c53ff67ea0b93a10fd35529051221c79c4e80cabced72230cefb3
6
+ metadata.gz: 0fde26b95c1f6e39ead11f894bea20634623d2d8de78e5f7485705e1a491dd111ade3f1103b3b77beea42ffb4481e89421c920ba0d413168d18a8b9624da34a5
7
+ data.tar.gz: 2df205c7237088708b851097bf7630731870a8e4d810d6c60c2cb35b0247794a6ce8fb391cdacd2b196d63b898ae343776e07d58cb95bfef97b5fe7a714857a7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/phase/dsl.rb CHANGED
@@ -7,25 +7,27 @@ module Phase
7
7
  # @see SSHKit::Coordinator for concurrency options
8
8
  # @return [void]
9
9
  def on_role(role_name, environment = "staging", options = {}, &block)
10
- servers = ::Phase::Adapters::AWS::Server.where(role: role_name, environment: environment)
10
+ servers = ::Phase.servers.where(role: role_name, environment: environment)
11
11
  on(servers.map {|s| s.resource.private_ip_address }, options, &block)
12
12
  end
13
13
 
14
- #
15
14
  def on(destination_ips, options = {}, &block)
16
- server = ::Phase::Adapters::AWS::Server.where(role: ::Phase.config.bastion_role).first
15
+ server = ::Phase.servers.where(role: ::Phase.config.bastion_role).first
17
16
  raise ArgumentError, "no servers found" unless server
18
17
 
18
+ # TODO: identify the CORRECT bastion host per subnet/network
19
19
  bastion_host = "#{ ::Phase.config.bastion_user }@#{ server.resource.dns_name }"
20
- coordinator = SSH::Coordinator.new(bastion_host)
20
+ coordinator = ::SSHKit::Coordinator.new(bastion_host)
21
21
 
22
- Array(destination_ips).each do |ip|
22
+ # TODO: clean up this logic. this should be done within a coordinator
23
+ # (or elsewhere) so we can ID networks on a per-adapter basis
24
+ results = Array(destination_ips).map do |ip|
23
25
  coordinator.each(options) do
24
26
  on_remote_host(ip) { instance_exec(&block) }
25
27
  end
26
28
  end
27
29
 
28
- true
30
+ results.flatten
29
31
  end
30
32
 
31
33
  def run_locally(&block)
data/lib/phase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phase
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/phase.rb CHANGED
@@ -15,7 +15,6 @@ require 'phase/adapters/aws'
15
15
 
16
16
  require 'phase/ssh/backend'
17
17
  require 'phase/ssh/command'
18
- require 'phase/ssh/coordinator'
19
18
 
20
19
  require 'phase/configuration'
21
20
  require 'phase/version'
data/phase.gemspec CHANGED
@@ -8,11 +8,13 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Phase::VERSION
9
9
  spec.authors = ["Piers Mainwaring", "Orca Health, Inc."]
10
10
  spec.email = ["piers@impossibly.org"]
11
- spec.summary = "Provides a simple API for managing cloud instances running in a multi-subnet network."
11
+ spec.summary = "A simple way to manage cloud instances within a multi-subnet network, like an AWS VPC."
12
12
  spec.description = ""
13
13
  spec.homepage = "https://github.com/piersadrian/phase"
14
14
  spec.license = "MIT"
15
15
 
16
+ spec.required_ruby_version = '~> 2.0'
17
+
16
18
  spec.files = `git ls-files -z`.split("\x0")
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -24,7 +26,6 @@ Gem::Specification.new do |spec|
24
26
  spec.add_runtime_dependency 'activesupport', '~> 4'
25
27
  spec.add_runtime_dependency 'fog', '~> 1.23'
26
28
  spec.add_runtime_dependency 'capistrano', '~> 3.2'
27
- spec.add_runtime_dependency 'mina', '~> 0.3'
28
29
  spec.add_runtime_dependency 'colorize', '~> 0.7'
29
30
  spec.add_runtime_dependency 'dotenv', '~> 0.11'
30
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piers Mainwaring
@@ -95,20 +95,6 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '3.2'
98
- - !ruby/object:Gem::Dependency
99
- name: mina
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '0.3'
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '0.3'
112
98
  - !ruby/object:Gem::Dependency
113
99
  name: colorize
114
100
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +208,6 @@ files:
222
208
  - lib/phase/keys/key.rb
223
209
  - lib/phase/ssh/backend.rb
224
210
  - lib/phase/ssh/command.rb
225
- - lib/phase/ssh/coordinator.rb
226
211
  - lib/phase/version.rb
227
212
  - phase.gemspec
228
213
  - spec/dsl_spec.rb
@@ -237,9 +222,9 @@ require_paths:
237
222
  - lib
238
223
  required_ruby_version: !ruby/object:Gem::Requirement
239
224
  requirements:
240
- - - ">="
225
+ - - "~>"
241
226
  - !ruby/object:Gem::Version
242
- version: '0'
227
+ version: '2.0'
243
228
  required_rubygems_version: !ruby/object:Gem::Requirement
244
229
  requirements:
245
230
  - - ">="
@@ -250,8 +235,8 @@ rubyforge_project:
250
235
  rubygems_version: 2.2.2
251
236
  signing_key:
252
237
  specification_version: 4
253
- summary: Provides a simple API for managing cloud instances running in a multi-subnet
254
- network.
238
+ summary: A simple way to manage cloud instances within a multi-subnet network, like
239
+ an AWS VPC.
255
240
  test_files:
256
241
  - spec/dsl_spec.rb
257
242
  - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- module Phase
2
- module SSH
3
- class Coordinator < ::SSHKit::Coordinator
4
-
5
- private
6
-
7
- # Prevents Coordinator from uniqifing @raw_hosts.
8
- def resolve_hosts
9
- @raw_hosts.map { |rh| rh.is_a?(::SSHKit::Host) ? rh : ::SSHKit::Host.new(rh) }
10
- end
11
- end
12
- end
13
- end