capistrano-asg-rolling 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +7 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +24 -21
- data/README.md +12 -0
- data/capistrano-asg-rolling.gemspec +1 -1
- data/lib/capistrano/asg/rolling/ami.rb +2 -2
- data/lib/capistrano/asg/rolling/autoscale_group.rb +5 -1
- data/lib/capistrano/asg/rolling/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8df47c0498d2086c65ea0b92eb4ac4fbcce15f253e6752ad1cbe1fedcf58abe5
|
4
|
+
data.tar.gz: 1ec79f6ab87ce44a220e003ec47dd9cc35843f824dc389756c69c4e0c4418265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70325e34622519ef8b91cc6d324ca0e22ebd61f7c69ce0011c1f0b958845ecacd8a0fbeba0985ca192c83b323e8a307dfb067271b2db0ade59332e7205062126
|
7
|
+
data.tar.gz: 9fa3da49333f7721986593de03f764d4bb75809ce2401b654de45548610d5b73c65357ccb88205d7516c55cf91d7191bef03c8dc1def11f091762cbd9e4cc33d
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -5,10 +5,13 @@ require:
|
|
5
5
|
|
6
6
|
AllCops:
|
7
7
|
NewCops: enable
|
8
|
-
TargetRubyVersion: 2.
|
8
|
+
TargetRubyVersion: 2.7
|
9
9
|
DisplayCopNames: true
|
10
10
|
DisplayStyleGuide: true
|
11
11
|
|
12
|
+
Gemspec/DevelopmentDependencies:
|
13
|
+
EnforcedStyle: gemspec
|
14
|
+
|
12
15
|
Layout/LineLength:
|
13
16
|
Enabled: false
|
14
17
|
|
@@ -24,5 +27,8 @@ Metrics/MethodLength:
|
|
24
27
|
RSpec/ExampleLength:
|
25
28
|
Max: 9
|
26
29
|
|
30
|
+
RSpec/IndexedLet:
|
31
|
+
Enabled: false
|
32
|
+
|
27
33
|
RSpec/MultipleExpectations:
|
28
34
|
Max: 5
|
data/Gemfile
CHANGED
@@ -7,7 +7,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
7
7
|
# Specify your gem's dependencies in capistrano-asg-rolling.gemspec
|
8
8
|
gemspec
|
9
9
|
|
10
|
-
gem 'rubocop', '~> 1.
|
11
|
-
gem 'rubocop-performance', '~> 1.
|
10
|
+
gem 'rubocop', '~> 1.52.0'
|
11
|
+
gem 'rubocop-performance', '~> 1.18.0'
|
12
12
|
gem 'rubocop-rake', '~> 0.6.0'
|
13
|
-
gem 'rubocop-rspec', '~> 2.
|
13
|
+
gem 'rubocop-rspec', '~> 2.22.0'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
capistrano-asg-rolling (0.
|
4
|
+
capistrano-asg-rolling (0.3.0)
|
5
5
|
aws-sdk-autoscaling (~> 1, >= 1.67.0)
|
6
6
|
aws-sdk-ec2 (~> 1)
|
7
7
|
capistrano (~> 3)
|
@@ -16,21 +16,21 @@ GEM
|
|
16
16
|
sshkit (>= 1.6.1, != 1.7.0)
|
17
17
|
ast (2.4.2)
|
18
18
|
aws-eventstream (1.2.0)
|
19
|
-
aws-partitions (1.
|
20
|
-
aws-sdk-autoscaling (1.
|
21
|
-
aws-sdk-core (~> 3, >= 3.
|
19
|
+
aws-partitions (1.774.0)
|
20
|
+
aws-sdk-autoscaling (1.90.0)
|
21
|
+
aws-sdk-core (~> 3, >= 3.174.0)
|
22
22
|
aws-sigv4 (~> 1.1)
|
23
|
-
aws-sdk-core (3.
|
23
|
+
aws-sdk-core (3.174.0)
|
24
24
|
aws-eventstream (~> 1, >= 1.0.2)
|
25
25
|
aws-partitions (~> 1, >= 1.651.0)
|
26
26
|
aws-sigv4 (~> 1.5)
|
27
27
|
jmespath (~> 1, >= 1.6.1)
|
28
|
-
aws-sdk-ec2 (1.
|
29
|
-
aws-sdk-core (~> 3, >= 3.
|
28
|
+
aws-sdk-ec2 (1.381.0)
|
29
|
+
aws-sdk-core (~> 3, >= 3.174.0)
|
30
30
|
aws-sigv4 (~> 1.1)
|
31
31
|
aws-sigv4 (1.5.2)
|
32
32
|
aws-eventstream (~> 1, >= 1.0.2)
|
33
|
-
capistrano (3.17.
|
33
|
+
capistrano (3.17.3)
|
34
34
|
airbrussh (>= 1.0.0)
|
35
35
|
i18n
|
36
36
|
rake (>= 10.0.0)
|
@@ -40,15 +40,15 @@ GEM
|
|
40
40
|
rexml
|
41
41
|
diff-lcs (1.5.0)
|
42
42
|
hashdiff (1.0.1)
|
43
|
-
i18n (1.
|
43
|
+
i18n (1.14.1)
|
44
44
|
concurrent-ruby (~> 1.0)
|
45
45
|
jmespath (1.6.2)
|
46
46
|
json (2.6.3)
|
47
47
|
net-scp (4.0.0)
|
48
48
|
net-ssh (>= 2.6.5, < 8.0.0)
|
49
49
|
net-ssh (7.1.0)
|
50
|
-
parallel (1.
|
51
|
-
parser (3.2.2.
|
50
|
+
parallel (1.23.0)
|
51
|
+
parser (3.2.2.1)
|
52
52
|
ast (~> 2.4.1)
|
53
53
|
public_suffix (5.0.1)
|
54
54
|
rainbow (3.1.1)
|
@@ -59,16 +59,16 @@ GEM
|
|
59
59
|
rspec-core (~> 3.12.0)
|
60
60
|
rspec-expectations (~> 3.12.0)
|
61
61
|
rspec-mocks (~> 3.12.0)
|
62
|
-
rspec-core (3.12.
|
62
|
+
rspec-core (3.12.2)
|
63
63
|
rspec-support (~> 3.12.0)
|
64
|
-
rspec-expectations (3.12.
|
64
|
+
rspec-expectations (3.12.3)
|
65
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
66
|
rspec-support (~> 3.12.0)
|
67
67
|
rspec-mocks (3.12.5)
|
68
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
69
|
rspec-support (~> 3.12.0)
|
70
70
|
rspec-support (3.12.0)
|
71
|
-
rubocop (1.
|
71
|
+
rubocop (1.52.0)
|
72
72
|
json (~> 2.3)
|
73
73
|
parallel (~> 1.10)
|
74
74
|
parser (>= 3.2.0.0)
|
@@ -78,18 +78,21 @@ GEM
|
|
78
78
|
rubocop-ast (>= 1.28.0, < 2.0)
|
79
79
|
ruby-progressbar (~> 1.7)
|
80
80
|
unicode-display_width (>= 2.4.0, < 3.0)
|
81
|
-
rubocop-ast (1.
|
81
|
+
rubocop-ast (1.29.0)
|
82
82
|
parser (>= 3.2.1.0)
|
83
|
-
rubocop-capybara (2.
|
83
|
+
rubocop-capybara (2.18.0)
|
84
84
|
rubocop (~> 1.41)
|
85
|
-
rubocop-
|
85
|
+
rubocop-factory_bot (2.23.1)
|
86
|
+
rubocop (~> 1.33)
|
87
|
+
rubocop-performance (1.18.0)
|
86
88
|
rubocop (>= 1.7.0, < 2.0)
|
87
89
|
rubocop-ast (>= 0.4.0)
|
88
90
|
rubocop-rake (0.6.0)
|
89
91
|
rubocop (~> 1.0)
|
90
|
-
rubocop-rspec (2.
|
92
|
+
rubocop-rspec (2.22.0)
|
91
93
|
rubocop (~> 1.33)
|
92
94
|
rubocop-capybara (~> 2.17)
|
95
|
+
rubocop-factory_bot (~> 2.22)
|
93
96
|
ruby-progressbar (1.13.0)
|
94
97
|
sshkit (1.21.4)
|
95
98
|
net-scp (>= 1.1.2)
|
@@ -108,10 +111,10 @@ DEPENDENCIES
|
|
108
111
|
capistrano-asg-rolling!
|
109
112
|
rake (~> 13.0)
|
110
113
|
rspec (~> 3.0)
|
111
|
-
rubocop (~> 1.
|
112
|
-
rubocop-performance (~> 1.
|
114
|
+
rubocop (~> 1.52.0)
|
115
|
+
rubocop-performance (~> 1.18.0)
|
113
116
|
rubocop-rake (~> 0.6.0)
|
114
|
-
rubocop-rspec (~> 2.
|
117
|
+
rubocop-rspec (~> 2.22.0)
|
115
118
|
webmock (~> 3.11)
|
116
119
|
|
117
120
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -125,6 +125,18 @@ autoscale 'app-autoscale-group', rolling: true # default: use rolling deploym
|
|
125
125
|
autoscale 'web-autoscale-group', rolling: false # override: use normal deployment
|
126
126
|
```
|
127
127
|
|
128
|
+
### Deploy with a custom percentage of minimum healthy instances during the instance refresh
|
129
|
+
|
130
|
+
The instance refresh is triggered by default with a requirement of 100% minimum healthy instances. ie. One instance is replaced at a time, and must be healthy and in-service before the next is replaced. This can mean that instance refreshes take a long time to complete, especially with larger numbers of instances with large warmup values. Reducing this value allows more instances to be terminated and new instances to be brought up at once during the instance refresh. eg. a value of 0 would terminate all instances in the autoscaling group and replace them at once.
|
131
|
+
|
132
|
+
You can configure the minimum healthy percentage per autoscaling group using the `healthy_percentage` option:
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
# config/deploy/<stage>.rb
|
136
|
+
autoscale 'app-autoscale-group', user: 'deployer' # default: use standard deployment with 100% minimum healthy instances
|
137
|
+
autoscale 'web-autoscale-group', user: 'deployer', healthy_percentage: 75 # override: allow 25% of instances to be terminated and replaced at once
|
138
|
+
```
|
139
|
+
|
128
140
|
### Custom stage
|
129
141
|
|
130
142
|
The rolling configuration of the stage has a side-effect: any Capistrano tasks you run, will also launch instances per Auto Scaling Group.
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ['lib']
|
28
28
|
|
29
|
-
spec.required_ruby_version = '>= 2.
|
29
|
+
spec.required_ruby_version = '>= 2.7.0'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
32
32
|
spec.add_development_dependency 'rake', '~> 13.0'
|
@@ -60,9 +60,9 @@ module Capistrano
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def snapshots
|
63
|
-
@snapshots ||= aws_ec2_image.block_device_mappings.
|
63
|
+
@snapshots ||= aws_ec2_image.block_device_mappings.filter_map do |mapping|
|
64
64
|
Snapshot.new(mapping.ebs.snapshot_id) if mapping.ebs
|
65
|
-
end
|
65
|
+
end
|
66
66
|
end
|
67
67
|
|
68
68
|
def tags
|
@@ -40,6 +40,10 @@ module Capistrano
|
|
40
40
|
aws_autoscaling_group.health_check_grace_period
|
41
41
|
end
|
42
42
|
|
43
|
+
def healthy_percentage
|
44
|
+
properties.fetch(:healthy_percentage, 100)
|
45
|
+
end
|
46
|
+
|
43
47
|
def start_instance_refresh(launch_template)
|
44
48
|
aws_autoscaling_client.start_instance_refresh(
|
45
49
|
auto_scaling_group_name: name,
|
@@ -52,7 +56,7 @@ module Capistrano
|
|
52
56
|
},
|
53
57
|
preferences: {
|
54
58
|
instance_warmup: instance_warmup_time,
|
55
|
-
min_healthy_percentage:
|
59
|
+
min_healthy_percentage: healthy_percentage,
|
56
60
|
skip_matching: true
|
57
61
|
}
|
58
62
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-asg-rolling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -180,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
180
|
requirements:
|
181
181
|
- - ">="
|
182
182
|
- !ruby/object:Gem::Version
|
183
|
-
version: 2.
|
183
|
+
version: 2.7.0
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
186
|
- - ">="
|