capistrano-aws 1.2.0 → 1.2.1

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
  SHA256:
3
- metadata.gz: 15806a2d357af5a45189d7d7b4bc7d391624a7dfd8f026568b07f9891125a7cd
4
- data.tar.gz: f6d462c93220344b750a71e1252d75b1710d292ab6d5685a0be73afceb069430
3
+ metadata.gz: b1c3b10ac2828ba8fa329df3458fd5f4df8f777f7a5f53b6d1774bfa0daf2518
4
+ data.tar.gz: 75f080dadf9cf60e262f16eb63733593eafaffa9211f89c66a5eafc50245c219
5
5
  SHA512:
6
- metadata.gz: ebdb4cf5fe5dd62f39daa99513a88636557bf8593f23bd846b0acc304d0484e8670dc93df08340c988b547ea4b14b9e4ca0bf6e579857ef4a3b413744fadaa67
7
- data.tar.gz: b5b2970b0275180caeff4daafbfc247a65314b687a379f72ca0e3b11a449c5a803becc1203ea5ef608c0592613f5651c9695aa0bb0b262c416464590094a247c
6
+ metadata.gz: 3b8459626eac2b171adb53979c0f0c17821c3fcd9bb0c7157f4803c1ad913ab6471eec93811d337e73df0eaf623634d5414090a9c0f6d08cba281dc447026a45
7
+ data.tar.gz: 17ec5886aa064ff07eb93a3f76529852d85695c02fd9c03476a7969c86d659377c5b96b70fbd9829419b3881d280d3232aa04abeffeaac1fb4082cefabec3b84
data/.gitignore CHANGED
@@ -1,3 +1 @@
1
- .bundle
2
- Gemfile.lock
3
- vendor
1
+ *.gem
data/README.md CHANGED
@@ -18,7 +18,7 @@ gem 'capistrano-aws'
18
18
 
19
19
  Or install the gem system-wide:
20
20
  ```bash
21
- gem install cap-ec2
21
+ gem install capistrano-aws
22
22
  ```
23
23
 
24
24
  In your `Capfile`:
@@ -63,6 +63,7 @@ The AWS credentials are loaded from your system. Check https://github.com/aws/aw
63
63
 
64
64
  The instances must be registered in each stage. In your `config/deploy/<stage_name>.rb`, add the following line:
65
65
 
66
+ *This must be placed after you have configured your AWS settings*
66
67
  ```ruby
67
68
  aws_ec2_register
68
69
  ```
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = 'capistrano-aws'
8
- gem.version = '1.2.0'
8
+ gem.version = '1.2.1'
9
9
  gem.author = 'Fernando Carletti'
10
10
  gem.email = 'contact@fernandocarletti.net'
11
11
  gem.homepage = 'http://github.com/fernandocarletti/capistrano-aws'
@@ -21,6 +21,7 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.required_ruby_version = '>= 2.0'
23
23
 
24
+ gem.add_dependency 'capistrano', '~> 3.1'
24
25
  gem.add_dependency 'aws-sdk-ec2', '~> 1'
25
26
  gem.add_dependency 'terminal-table', '~> 1.7'
26
27
  gem.add_dependency 'colorize', '~> 0.8'
File without changes
@@ -1,13 +1,9 @@
1
1
  require 'capistrano/aws/ec2/ec2'
2
2
  require 'capistrano/dsl/aws'
3
+
3
4
  extend Capistrano::DSL::Aws
4
5
 
5
6
  SSHKit::Backend::Netssh.send(:include, Capistrano::DSL::Aws)
6
7
 
7
8
  load File.expand_path('../tasks/ec2.rake', __FILE__)
8
-
9
- namespace :load do
10
- task :defaults do
11
- load 'capistrano/aws/defaults.rb'
12
- end
13
- end
9
+ load File.expand_path("../tasks/defaults.rake", __FILE__)
@@ -22,25 +22,9 @@ module Capistrano
22
22
  end
23
23
 
24
24
  def instances
25
- application = fetch(:aws_ec2_application)
26
- raise 'application not set.' if application.nil?
27
-
28
25
  instances = {}
29
26
 
30
- filters = [
31
- {
32
- name: "tag:#{fetch(:aws_ec2_application_tag)}",
33
- values: [fetch(:aws_ec2_application)]
34
- },
35
- {
36
- name: "tag:#{fetch(:aws_ec2_stage_tag)}",
37
- values: [fetch(:aws_ec2_stage)]
38
- },
39
- {
40
- name: 'instance-state-name',
41
- values: ['running']
42
- }
43
- ]
27
+ filters = fetch(:aws_ec2_default_filters)
44
28
 
45
29
  filters.concat fetch(:aws_ec2_extra_filters)
46
30
 
@@ -9,7 +9,7 @@ module Capistrano
9
9
  def aws_ec2_register(options = {})
10
10
  aws_ec2.instances.each do |_id, instance|
11
11
  ip = Capistrano::Aws::EC2.contact_point(instance)
12
- roles = Capistrano::Aws::EC2.parse_tag(instance, fetch(:aws_ec2_roles_tag)).split(',')
12
+ roles = Capistrano::Aws::EC2.parse_tag(instance, fetch(:aws_ec2_roles_tag)).split(",").map(&:strip)
13
13
 
14
14
  server ip, options.merge(roles: roles, aws_instance_id: instance.id)
15
15
  end
@@ -0,0 +1,48 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ # AWS regions to use.
4
+ set :aws_ec2_regions, ['us-east-1']
5
+
6
+ # Application name to match application tag.
7
+ set :aws_ec2_application, (proc { fetch(:application) })
8
+
9
+ # Stage to match stage tag.
10
+ set :aws_ec2_stage, (proc { fetch(:stage) })
11
+
12
+ # Tag to be used for Capistrano stage.
13
+ set :aws_ec2_stage_tag, 'Stage'
14
+
15
+ # Tag to be used to match the application.
16
+ set :aws_ec2_application_tag, 'Application'
17
+
18
+ # Tag to be used for Capistrano roles of the server (the tag value can be a comma separated list).
19
+ set :aws_ec2_roles_tag, 'Roles'
20
+
21
+ # Default filters used for all requests, set to an empty array [] to disable completely
22
+ set :aws_ec2_default_filters, (proc {
23
+ [
24
+ {
25
+ name: "tag:#{fetch(:aws_ec2_application_tag)}",
26
+ values: [fetch(:aws_ec2_application)]
27
+ },
28
+ {
29
+ name: "tag:#{fetch(:aws_ec2_stage_tag)}",
30
+ values: [fetch(:aws_ec2_stage)]
31
+ },
32
+ {
33
+ name: 'instance-state-name',
34
+ values: ['running']
35
+ }
36
+ ]
37
+ })
38
+
39
+ # Extra filters to be used to retrieve the instances. See the README.md for more information.
40
+ set :aws_ec2_extra_filters, []
41
+
42
+ # Tag to be used as the instance name in the instances table (aws:ec2:instances task).
43
+ set :aws_ec2_name_tag, 'Name'
44
+
45
+ # How to contact the instance (:public_ip, :public_dns, :private_ip).
46
+ set :aws_ec2_contact_point, :public_ip
47
+ end
48
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: aws-sdk-ec2
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,11 +94,12 @@ files:
80
94
  - LICENSE
81
95
  - README.md
82
96
  - capistrano-aws.gemspec
97
+ - lib/capistrano-aws.rb
83
98
  - lib/capistrano/aws.rb
84
- - lib/capistrano/aws/defaults.rb
85
99
  - lib/capistrano/aws/ec2/ec2.rb
86
100
  - lib/capistrano/aws/ec2/instances_table.rb
87
101
  - lib/capistrano/dsl/aws.rb
102
+ - lib/capistrano/tasks/defaults.rake
88
103
  - lib/capistrano/tasks/ec2.rake
89
104
  homepage: http://github.com/fernandocarletti/capistrano-aws
90
105
  licenses:
@@ -105,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
120
  - !ruby/object:Gem::Version
106
121
  version: '0'
107
122
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.7.6
123
+ rubygems_version: 3.0.6
110
124
  signing_key:
111
125
  specification_version: 4
112
126
  summary: Integrates capistrano with AWS.
@@ -1,26 +0,0 @@
1
- # AWS regions to use.
2
- set :aws_ec2_regions, ['us-east-1']
3
-
4
- # Application name to match application tag.
5
- set :aws_ec2_application, (proc { fetch(:application) })
6
-
7
- # Stage to match stage tag.
8
- set :aws_ec2_stage, (proc { fetch(:stage) })
9
-
10
- # Tag to be used for Capistrano stage.
11
- set :aws_ec2_stage_tag, 'Stage'
12
-
13
- # Tag to be used to match the application.
14
- set :aws_ec2_application_tag, 'Application'
15
-
16
- # Tag to be used for Capistrano roles of the server (the tag value can be a comma separated list).
17
- set :aws_ec2_roles_tag, 'Roles'
18
-
19
- # Extra filters to be used to retrieve the instances. See the README.md for more information.
20
- set :aws_ec2_extra_filters, []
21
-
22
- # Tag to be used as the instance name in the instances table (aws:ec2:instances task).
23
- set :aws_ec2_name_tag, 'Name'
24
-
25
- # How to contact the instance (:public_ip, :public_dns, :private_ip).
26
- set :aws_ec2_contact_point, :public_ip