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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 201b0bf6f65154de3bef482b74683de12e689957f2776924b5b6b6187eb8523e
4
- data.tar.gz: 182402f95b0dd18f6376566632b0712b8f049ca8fd67f454ce750be296e3cc5d
3
+ metadata.gz: 8df47c0498d2086c65ea0b92eb4ac4fbcce15f253e6752ad1cbe1fedcf58abe5
4
+ data.tar.gz: 1ec79f6ab87ce44a220e003ec47dd9cc35843f824dc389756c69c4e0c4418265
5
5
  SHA512:
6
- metadata.gz: cfa3660b65b46f41fabe64ec8a5cc052189e4752ae2ac4a6635055c2b143595d0c402773e1255ddc6ff0b0ed3d6d83a53742abc5ed4ac7b42170b0ca268837a0
7
- data.tar.gz: 36d6647e1bf5524b488c5b61dcd65cd6b14087d1ea8110a191496bc7127a0091002295375a380e3210622ded106a54442533c57443b0122b8f57f42d3bab5f5f
6
+ metadata.gz: 70325e34622519ef8b91cc6d324ca0e22ebd61f7c69ce0011c1f0b958845ecacd8a0fbeba0985ca192c83b323e8a307dfb067271b2db0ade59332e7205062126
7
+ data.tar.gz: 9fa3da49333f7721986593de03f764d4bb75809ce2401b654de45548610d5b73c65357ccb88205d7516c55cf91d7191bef03c8dc1def11f091762cbd9e4cc33d
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
12
+ ruby-version: ['2.7', '3.0', '3.1', '3.2']
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -5,10 +5,13 @@ require:
5
5
 
6
6
  AllCops:
7
7
  NewCops: enable
8
- TargetRubyVersion: 2.6
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.50.2'
11
- gem 'rubocop-performance', '~> 1.17.0'
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.19.0'
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.2.1)
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.748.0)
20
- aws-sdk-autoscaling (1.89.0)
21
- aws-sdk-core (~> 3, >= 3.165.0)
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.171.0)
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.375.0)
29
- aws-sdk-core (~> 3, >= 3.165.0)
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.2)
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.12.0)
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.22.1)
51
- parser (3.2.2.0)
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.1)
62
+ rspec-core (3.12.2)
63
63
  rspec-support (~> 3.12.0)
64
- rspec-expectations (3.12.2)
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.50.2)
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.28.0)
81
+ rubocop-ast (1.29.0)
82
82
  parser (>= 3.2.1.0)
83
- rubocop-capybara (2.17.1)
83
+ rubocop-capybara (2.18.0)
84
84
  rubocop (~> 1.41)
85
- rubocop-performance (1.17.1)
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.19.0)
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.50.2)
112
- rubocop-performance (~> 1.17.0)
114
+ rubocop (~> 1.52.0)
115
+ rubocop-performance (~> 1.18.0)
113
116
  rubocop-rake (~> 0.6.0)
114
- rubocop-rspec (~> 2.19.0)
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.6.0'
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.map do |mapping|
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.compact
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: 100,
59
+ min_healthy_percentage: healthy_percentage,
56
60
  skip_matching: true
57
61
  }
58
62
  )
@@ -3,7 +3,7 @@
3
3
  module Capistrano
4
4
  module ASG
5
5
  module Rolling
6
- VERSION = '0.2.1'
6
+ VERSION = '0.3.0'
7
7
  end
8
8
  end
9
9
  end
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.2.1
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-04-17 00:00:00.000000000 Z
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.6.0
183
+ version: 2.7.0
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - ">="