capistrano-asg 0.5.1 → 0.5.2
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/CHANGELOG.md +15 -0
- data/README.md +16 -0
- data/lib/capistrano/asg/tasks/asg.rake +6 -0
- data/lib/capistrano/asg/version.rb +3 -1
- data/lib/capistrano/asg.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640eab457e1530da23b85b9eb0f16b9fe53116c9
|
4
|
+
data.tar.gz: 34a6538f0c47571d89ba43a7853b5ca6e5d22b13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22e1da471c952d26792769cbd305fc5adb3a9b971d44a173abeea702a72cef9b0cf434915bec7ebeb47c65d91e22c440e1cff47273a9e6552ffd3a32086e0170
|
7
|
+
data.tar.gz: 277b16a70df699773e1c423a22180d38c4050bdff2da7b201fc3d36abd1f97bf5d5fea7c3130bdbfb17955f9b3ffb04d4139aa66c0a76f321f9ebde44abdb68e
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# 0.5.2
|
2
|
+
|
3
|
+
* Run after deploy:finishing instead of after deploy
|
4
|
+
* Return newly created launch configuration in `fetch(:asg_launch_config)`
|
5
|
+
|
6
|
+
# 0.5.1
|
7
|
+
|
8
|
+
* Fix multi-region AMI and launch config generation
|
9
|
+
|
10
|
+
# 0.5.0
|
11
|
+
|
12
|
+
* Forked from capistrano-elbas
|
13
|
+
* renamed capistrano-asg and released as a new gem
|
14
|
+
* Updated with modern aws sdk
|
15
|
+
* Added support for multiple regions
|
data/README.md
CHANGED
@@ -65,6 +65,22 @@ regions.each do |region|
|
|
65
65
|
end
|
66
66
|
```
|
67
67
|
|
68
|
+
The name of the newly created launch configurations are available via `fetch(:asg_launch_config)`.
|
69
|
+
This is a two-dimensional hash with region and autoscaling group name as keys.
|
70
|
+
You can output these or store them as necessary in an `after 'deploy:finished'` hook.
|
71
|
+
An example value is:
|
72
|
+
|
73
|
+
```
|
74
|
+
{
|
75
|
+
'us-east-1' => {
|
76
|
+
'asg-app' => 'cap-asg-production-app-server-private-asg-lc-1501619456'
|
77
|
+
},
|
78
|
+
'eu-west-1' => {
|
79
|
+
'asg-app' => 'cap-asg-production-app-server-private-asg-lc-1501619454'
|
80
|
+
}
|
81
|
+
}
|
82
|
+
```
|
83
|
+
|
68
84
|
That's it! Run `cap production deploy`. The following log statements are printed
|
69
85
|
during deployment:
|
70
86
|
|
@@ -4,11 +4,14 @@ namespace :asg do
|
|
4
4
|
task :scale do
|
5
5
|
set :aws_access_key_id, fetch(:aws_access_key_id, ENV['AWS_ACCESS_KEY_ID'])
|
6
6
|
set :aws_secret_access_key, fetch(:aws_secret_access_key, ENV['AWS_SECRET_ACCESS_KEY'])
|
7
|
+
asg_launch_config = {}
|
7
8
|
|
8
9
|
# Iterate over relevant regions
|
9
10
|
regions = fetch(:regions)
|
10
11
|
regions.keys.each do |region|
|
11
12
|
set :aws_region, region
|
13
|
+
asg_launch_config[region] = {}
|
14
|
+
|
12
15
|
# Iterate over relevant ASGs
|
13
16
|
regions[region].each do |asg|
|
14
17
|
set :aws_autoscale_group, asg
|
@@ -16,10 +19,13 @@ namespace :asg do
|
|
16
19
|
puts "Autoscaling: Created AMI: #{ami.aws_counterpart.id} from region #{region} in ASG #{asg}"
|
17
20
|
Capistrano::Asg::LaunchConfiguration.create(ami) do |lc|
|
18
21
|
puts "Autoscaling: Created Launch Configuration: #{lc.aws_counterpart.name} from region #{region} in ASG #{asg}"
|
22
|
+
asg_launch_config[region][asg] = lc.aws_counterpart.name
|
19
23
|
lc.attach_to_autoscale_group!
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
28
|
+
|
29
|
+
set :asg_launch_config, asg_launch_config
|
24
30
|
end
|
25
31
|
end
|
data/lib/capistrano/asg.rb
CHANGED
@@ -49,7 +49,7 @@ def autoscale(groupname, *args)
|
|
49
49
|
end
|
50
50
|
|
51
51
|
if asg_instances.count > 0
|
52
|
-
after('deploy', 'asg:scale')
|
52
|
+
after('deploy:finishing', 'asg:scale')
|
53
53
|
else
|
54
54
|
puts 'Autoscaling: AMI could not be created because no running instances were found.\
|
55
55
|
Is your autoscale group name correct?'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-asg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Serman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-08-
|
13
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- ".gitignore"
|
125
125
|
- ".rspec"
|
126
126
|
- ".travis.yml"
|
127
|
+
- CHANGELOG.md
|
127
128
|
- Gemfile
|
128
129
|
- LICENSE.txt
|
129
130
|
- README.md
|