capistrano-autoscale 1.0.9 → 1.0.13

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
  SHA256:
3
- metadata.gz: fa25db298d32e210d08f652c69c6a63d5ee8f5ac92be54edee6c90fe557b9110
4
- data.tar.gz: fb4f792c88cbb931baa04ef6f2a6f932893004453a5a0464e9e495b3baed341d
3
+ metadata.gz: a5def3fa92d9a4cdf8599627cc47eb0c341653f4dbc4d77db5dba1c78f128ef4
4
+ data.tar.gz: 3232e53a8cd79407bbdd8e4ff3346507c25dd60428c298176f012bacdb5adaae
5
5
  SHA512:
6
- metadata.gz: 3cb01ac4f28155d2300598ee27d3bc81ef0ad902a3889954f88102d3ba1f315dcfe9ce68530e4c1ccbe51d772f2472e0660df9e27514e32370428b9640d31cc2
7
- data.tar.gz: 56158a941cee184e6ed472939f735ffc7c3a6ef1261c9049a58251a53dfd021d956fef9412b938e0aece12780c0212bd3d5a31ef9aab8864c3434918debc96da
6
+ metadata.gz: 54ae430172f9996392bfdbe73dd29e27b0e4c449777b8937982ba0a58fb17c45bad0b58a9c58133c7f09f64482d4cf777775b05b4b39e50773cac1bf354f4c75
7
+ data.tar.gz: dcdf49e14be2bf290d1e84abbac568525036260a56f11b27942e3bf81ed4fa23cb9847899f06b266ddae603718b06826046a442a66aed9e04ac4844f4414984c
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016 Clinch Technology, Ltd.
3
+ Copyright (c) 2021 Clinch Technology, Ltd.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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", "~> 10.0"
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
 
@@ -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
- hostname = ec2_instance(instance.instance_id).private_ip_address
34
- p "Autoscale deploying to: #{hostname}"
35
- server(hostname, *args)
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/credentials'
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
- @autoscale_groups ||= ::Aws::AutoScaling::Client.new(autoscaling_credentials).describe_auto_scaling_groups({auto_scaling_group_names: [autoscale_group_names].flatten}).auto_scaling_groups
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
@@ -1,5 +1,5 @@
1
1
  require 'aws-sdk-ec2'
2
- require 'capistrano/autoscale/aws/credentials'
2
+ require 'capistrano/autoscale/aws/autoscaling_credentials'
3
3
 
4
4
  module Capistrano
5
5
  module Autoscale
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Autoscale
3
- VERSION = '1.0.9'
3
+ VERSION = '1.0.13'
4
4
  end
5
5
  end
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.9
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: 2018-08-29 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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
- rubyforge_project:
169
- rubygems_version: 2.7.7
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: []