capistrano-autoscale 1.0.9 → 1.0.13
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 +4 -4
- data/LICENSE +1 -1
- data/README.md +11 -4
- data/capistrano-autoscale.gemspec +1 -1
- data/lib/capistrano/autoscale.rb +10 -4
- data/lib/capistrano/autoscale/aws/autoscaling_credentials.rb +1 -0
- data/lib/capistrano/autoscale/aws/autoscaling_group.rb +2 -2
- data/lib/capistrano/autoscale/aws/ec2.rb +1 -1
- data/lib/capistrano/autoscale/version.rb +1 -1
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5def3fa92d9a4cdf8599627cc47eb0c341653f4dbc4d77db5dba1c78f128ef4
|
4
|
+
data.tar.gz: 3232e53a8cd79407bbdd8e4ff3346507c25dd60428c298176f012bacdb5adaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ae430172f9996392bfdbe73dd29e27b0e4c449777b8937982ba0a58fb17c45bad0b58a9c58133c7f09f64482d4cf777775b05b4b39e50773cac1bf354f4c75
|
7
|
+
data.tar.gz: dcdf49e14be2bf290d1e84abbac568525036260a56f11b27942e3bf81ed4fa23cb9847899f06b266ddae603718b06826046a442a66aed9e04ac4844f4414984c
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -15,16 +15,23 @@ Add this statement to your Capfile:
|
|
15
15
|
|
16
16
|
## Configuration
|
17
17
|
|
18
|
-
Below are the Capistrano configuration options with their defaults:
|
18
|
+
Below are the Capistrano configuration options with their defaults (session_token is optional):
|
19
19
|
|
20
20
|
```
|
21
21
|
set :aws_access_key_id, ENV['AWS_ACCESS_KEY_ID']
|
22
22
|
set :aws_secret_access_key, ENV['AWS_SECRET_ACCESS_KEY']
|
23
|
+
set :aws_session_token, ENV['AWS_SESSION_TOKEN']
|
23
24
|
set :aws_region, ENV['AWS_REGION']
|
24
25
|
```
|
25
26
|
|
26
|
-
And set the autoscale group:
|
27
|
+
And set the autoscale group using IP Address:
|
27
28
|
|
28
29
|
```
|
29
|
-
autoscale [<array of auto-scale-group-names>], user: '<deployment user>', roles: [<array of cap roles>]
|
30
|
-
```
|
30
|
+
autoscale [<array of auto-scale-group-names>], :ip_address, user: '<deployment user>', roles: [<array of cap roles>]
|
31
|
+
```
|
32
|
+
|
33
|
+
Or, set the autoscale group using EC2 Instance Id:
|
34
|
+
|
35
|
+
```
|
36
|
+
autoscale [<array of auto-scale-group-names>], :instance_id, user: '<deployment user>', roles: [<array of cap roles>]
|
37
|
+
```
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.13"
|
22
|
-
spec.add_development_dependency "rake", "~>
|
22
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
23
23
|
spec.add_development_dependency "minitest", "~> 5.0"
|
24
24
|
spec.add_development_dependency "webmock", "~> 3"
|
25
25
|
|
data/lib/capistrano/autoscale.rb
CHANGED
@@ -12,7 +12,7 @@ module Capistrano
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def autoscale(groupnames, *args)
|
15
|
+
def autoscale(groupnames, identifier_type, *args)
|
16
16
|
include Capistrano::DSL
|
17
17
|
include Capistrano::Autoscale::Aws::AutoscalingGroup
|
18
18
|
include Capistrano::Autoscale::Aws::EC2
|
@@ -30,11 +30,17 @@ def autoscale(groupnames, *args)
|
|
30
30
|
end
|
31
31
|
|
32
32
|
instances.each do |instance|
|
33
|
-
|
34
|
-
p "Autoscale deploying to: #{
|
35
|
-
server(
|
33
|
+
host = host_by_identifier(instance, identifier_type)
|
34
|
+
p "Autoscale deploying to: #{host}"
|
35
|
+
server(host, *args)
|
36
36
|
end
|
37
37
|
else
|
38
38
|
p "Error: No #{groupnames} autoscale group found."
|
39
39
|
end
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def host_by_identifier(instance, identifier_type)
|
45
|
+
identifier_type == :ip_address ? ec2_instance(instance.instance_id).private_ip_address : instance.instance_id
|
40
46
|
end
|
@@ -9,6 +9,7 @@ module Capistrano
|
|
9
9
|
access_key_id: fetch(:aws_access_key_id, ENV['AWS_ACCESS_KEY_ID']),
|
10
10
|
secret_access_key: fetch(:aws_secret_access_key, ENV['AWS_SECRET_ACCESS_KEY'])
|
11
11
|
}
|
12
|
+
credentials.merge! session_token: fetch(:aws_session_token, ENV['AWS_SESSION_TOKEN']) if fetch(:aws_session_token, ENV['AWS_SESSION_TOKEN'])
|
12
13
|
credentials.merge! region: fetch(:aws_region) if fetch(:aws_region)
|
13
14
|
credentials
|
14
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'aws-sdk-autoscaling'
|
2
|
-
require 'capistrano/autoscale/aws/
|
2
|
+
require 'capistrano/autoscale/aws/autoscaling_credentials'
|
3
3
|
|
4
4
|
module Capistrano
|
5
5
|
module Autoscale
|
@@ -9,7 +9,7 @@ module Capistrano
|
|
9
9
|
include Capistrano::DSL
|
10
10
|
|
11
11
|
def autoscale_groups
|
12
|
-
|
12
|
+
::Aws::AutoScaling::Client.new(autoscaling_credentials).describe_auto_scaling_groups({auto_scaling_group_names: [autoscale_group_names].flatten}).auto_scaling_groups
|
13
13
|
end
|
14
14
|
|
15
15
|
def autoscale_group_names
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-autoscale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien Glancy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,7 +150,7 @@ homepage: https://github.com/ClinchIO/capistrano-autoscale
|
|
150
150
|
licenses:
|
151
151
|
- MIT
|
152
152
|
metadata: {}
|
153
|
-
post_install_message:
|
153
|
+
post_install_message:
|
154
154
|
rdoc_options: []
|
155
155
|
require_paths:
|
156
156
|
- lib
|
@@ -165,9 +165,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
|
169
|
-
|
170
|
-
signing_key:
|
168
|
+
rubygems_version: 3.1.2
|
169
|
+
signing_key:
|
171
170
|
specification_version: 4
|
172
171
|
summary: Capistrano plugin for deploying to AWS AutoScale groups.
|
173
172
|
test_files: []
|