capistrano-aws-autodiscover 2.0.0 → 3.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c11063d1134ca7606a74185cb350632db469411
4
- data.tar.gz: c694f743462e694b1718d7eb8b219129931748cd
3
+ metadata.gz: 3261ee5368775cf105306c88706a65034f543598
4
+ data.tar.gz: b2fbf30821e56c4060d0becd759653aacdb11526
5
5
  SHA512:
6
- metadata.gz: 3f556bf87d21157ef6ed8b17c5df51fbe264377161dc040c8b23a6967602edd95f0d76359a6f301192246a9a18bf34cd59332878facea105f0794a8a2880f3fc
7
- data.tar.gz: 7af3577d5e0ba04ef9af861b27181143a11205fb636bd7924b0fc8aa51faa5b0a10522d1b9b17062dcc2015db27523423b611c445e11a8e3827d90c6d2621012
6
+ metadata.gz: ceb27bf3dcd8dc2819a3902577dddd02208f119a125e56912899bc8005f32f29e3c9c92faf228bfc0b41ff64701dad4e86460e0a6b3e76f2dccaf6369304bb63
7
+ data.tar.gz: c1c37a6a996540ae9c8123975d3b376b0b0f1073ca0f74212341b1ec3fac77a0634a43714dd72cb09832d4047ca6902c1f69dcef9b8e232657b6048d524a8cd9
@@ -1,14 +1,16 @@
1
1
  require "capistrano-aws-autodiscover/version"
2
2
  require 'aws-sdk-core'
3
3
 
4
- Capistrano::Configuration.instance(:must_exist).load do
5
- def define_servers
4
+ class CapistranoAwsAutodiscover
5
+
6
+ Instance = Struct.new(:dns, :roles)
7
+
8
+ def self.define_servers
6
9
  instances = CapistranoAwsAutodiscover.new(fetch(:aws_key_id), fetch(:secret_access_key), fetch(:aws_region), fetch(:ec2_project), fetch(:ec2_env)).execute
7
- instances.each {|s| server *s}
10
+ instances.each do |s|
11
+ server s.dns, roles: s.roles, user: fetch(:user)
12
+ end
8
13
  end
9
- end
10
-
11
- class CapistranoAwsAutodiscover
12
14
 
13
15
  def initialize(key, secret, aws_region, project, environment)
14
16
  @key = key
@@ -57,10 +59,9 @@ class CapistranoAwsAutodiscover
57
59
  end
58
60
 
59
61
  def make_args(instance)
60
- public_dns = instance.public_dns_name
62
+ dns = instance.public_dns_name
61
63
  roles_tag = instance.tags.find {|t| t.key == "Roles"}.value
62
64
  roles = roles_tag.split(/,|;/)
63
- [public_dns, roles].flatten
65
+ Instance.new(dns, roles)
64
66
  end
65
-
66
67
  end
@@ -1,3 +1,3 @@
1
1
  class CapistranoAwsAutodiscover
2
- VERSION = "2.0.0"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-aws-autodiscover
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erez Rabih
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-14 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler