capistrano-asg-rolling 0.2.0 → 0.2.1

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: 140ff8c2812256ee7b0db1c2675052859dd933593d6f3766adf68e855c2297b5
4
- data.tar.gz: 76ba60506093dac285def220cb11c8f114140c525d3c65644e5d6af983edaaaf
3
+ metadata.gz: 201b0bf6f65154de3bef482b74683de12e689957f2776924b5b6b6187eb8523e
4
+ data.tar.gz: 182402f95b0dd18f6376566632b0712b8f049ca8fd67f454ce750be296e3cc5d
5
5
  SHA512:
6
- metadata.gz: 85c502bd99f24aea1dd05fc2a499dbc3aec81be2b951dd9be3c056d1527ba51bf0d605eca6b3ab40ece1f3a7d559f400cafb50ca5884567d214c665fd7e50057
7
- data.tar.gz: bd945c98f2dc32c63e7fac3df0a82ea9ab7a75b2cc2caeab6b24d640bd7af9bfe79c1f6f863f467a42f14d7043f18775667706cae4631552d7199a45a55b6edc
6
+ metadata.gz: cfa3660b65b46f41fabe64ec8a5cc052189e4752ae2ac4a6635055c2b143595d0c402773e1255ddc6ff0b0ed3d6d83a53742abc5ed4ac7b42170b0ca268837a0
7
+ data.tar.gz: 36d6647e1bf5524b488c5b61dcd65cd6b14087d1ea8110a191496bc7127a0091002295375a380e3210622ded106a54442533c57443b0122b8f57f42d3bab5f5f
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1']
12
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -5,7 +5,7 @@ require:
5
5
 
6
6
  AllCops:
7
7
  NewCops: enable
8
- TargetRubyVersion: 2.5
8
+ TargetRubyVersion: 2.6
9
9
  DisplayCopNames: true
10
10
  DisplayStyleGuide: true
11
11
 
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.26.1'
11
- gem 'rubocop-performance', '~> 1.13.3'
10
+ gem 'rubocop', '~> 1.50.2'
11
+ gem 'rubocop-performance', '~> 1.17.0'
12
12
  gem 'rubocop-rake', '~> 0.6.0'
13
- gem 'rubocop-rspec', '~> 2.9.0'
13
+ gem 'rubocop-rspec', '~> 2.19.0'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-asg-rolling (0.2.0)
4
+ capistrano-asg-rolling (0.2.1)
5
5
  aws-sdk-autoscaling (~> 1, >= 1.67.0)
6
6
  aws-sdk-ec2 (~> 1)
7
7
  capistrano (~> 3)
@@ -10,87 +10,92 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.0)
14
- public_suffix (>= 2.0.2, < 5.0)
15
- airbrussh (1.4.0)
13
+ addressable (2.8.4)
14
+ public_suffix (>= 2.0.2, < 6.0)
15
+ airbrussh (1.4.1)
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.570.0)
20
- aws-sdk-autoscaling (1.78.0)
21
- aws-sdk-core (~> 3, >= 3.127.0)
19
+ aws-partitions (1.748.0)
20
+ aws-sdk-autoscaling (1.89.0)
21
+ aws-sdk-core (~> 3, >= 3.165.0)
22
22
  aws-sigv4 (~> 1.1)
23
- aws-sdk-core (3.130.0)
23
+ aws-sdk-core (3.171.0)
24
24
  aws-eventstream (~> 1, >= 1.0.2)
25
- aws-partitions (~> 1, >= 1.525.0)
25
+ aws-partitions (~> 1, >= 1.651.0)
26
+ aws-sigv4 (~> 1.5)
27
+ jmespath (~> 1, >= 1.6.1)
28
+ aws-sdk-ec2 (1.375.0)
29
+ aws-sdk-core (~> 3, >= 3.165.0)
26
30
  aws-sigv4 (~> 1.1)
27
- jmespath (~> 1.0)
28
- aws-sdk-ec2 (1.303.0)
29
- aws-sdk-core (~> 3, >= 3.127.0)
30
- aws-sigv4 (~> 1.1)
31
- aws-sigv4 (1.4.0)
31
+ aws-sigv4 (1.5.2)
32
32
  aws-eventstream (~> 1, >= 1.0.2)
33
- capistrano (3.17.0)
33
+ capistrano (3.17.2)
34
34
  airbrussh (>= 1.0.0)
35
35
  i18n
36
36
  rake (>= 10.0.0)
37
37
  sshkit (>= 1.9.0)
38
- concurrent-ruby (1.1.10)
38
+ concurrent-ruby (1.2.2)
39
39
  crack (0.4.5)
40
40
  rexml
41
41
  diff-lcs (1.5.0)
42
42
  hashdiff (1.0.1)
43
- i18n (1.10.0)
43
+ i18n (1.12.0)
44
44
  concurrent-ruby (~> 1.0)
45
- jmespath (1.6.1)
46
- net-scp (3.0.0)
47
- net-ssh (>= 2.6.5, < 7.0.0)
48
- net-ssh (6.1.0)
49
- parallel (1.22.0)
50
- parser (3.1.1.0)
45
+ jmespath (1.6.2)
46
+ json (2.6.3)
47
+ net-scp (4.0.0)
48
+ net-ssh (>= 2.6.5, < 8.0.0)
49
+ net-ssh (7.1.0)
50
+ parallel (1.22.1)
51
+ parser (3.2.2.0)
51
52
  ast (~> 2.4.1)
52
- public_suffix (4.0.6)
53
+ public_suffix (5.0.1)
53
54
  rainbow (3.1.1)
54
55
  rake (13.0.6)
55
- regexp_parser (2.2.1)
56
+ regexp_parser (2.8.0)
56
57
  rexml (3.2.5)
57
- rspec (3.10.0)
58
- rspec-core (~> 3.10.0)
59
- rspec-expectations (~> 3.10.0)
60
- rspec-mocks (~> 3.10.0)
61
- rspec-core (3.10.2)
62
- rspec-support (~> 3.10.0)
63
- rspec-expectations (3.10.2)
58
+ rspec (3.12.0)
59
+ rspec-core (~> 3.12.0)
60
+ rspec-expectations (~> 3.12.0)
61
+ rspec-mocks (~> 3.12.0)
62
+ rspec-core (3.12.1)
63
+ rspec-support (~> 3.12.0)
64
+ rspec-expectations (3.12.2)
64
65
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.10.0)
66
- rspec-mocks (3.10.3)
66
+ rspec-support (~> 3.12.0)
67
+ rspec-mocks (3.12.5)
67
68
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.10.0)
69
- rspec-support (3.10.3)
70
- rubocop (1.26.1)
69
+ rspec-support (~> 3.12.0)
70
+ rspec-support (3.12.0)
71
+ rubocop (1.50.2)
72
+ json (~> 2.3)
71
73
  parallel (~> 1.10)
72
- parser (>= 3.1.0.0)
74
+ parser (>= 3.2.0.0)
73
75
  rainbow (>= 2.2.2, < 4.0)
74
76
  regexp_parser (>= 1.8, < 3.0)
75
- rexml
76
- rubocop-ast (>= 1.16.0, < 2.0)
77
+ rexml (>= 3.2.5, < 4.0)
78
+ rubocop-ast (>= 1.28.0, < 2.0)
77
79
  ruby-progressbar (~> 1.7)
78
- unicode-display_width (>= 1.4.0, < 3.0)
79
- rubocop-ast (1.16.0)
80
- parser (>= 3.1.1.0)
81
- rubocop-performance (1.13.3)
80
+ unicode-display_width (>= 2.4.0, < 3.0)
81
+ rubocop-ast (1.28.0)
82
+ parser (>= 3.2.1.0)
83
+ rubocop-capybara (2.17.1)
84
+ rubocop (~> 1.41)
85
+ rubocop-performance (1.17.1)
82
86
  rubocop (>= 1.7.0, < 2.0)
83
87
  rubocop-ast (>= 0.4.0)
84
88
  rubocop-rake (0.6.0)
85
89
  rubocop (~> 1.0)
86
- rubocop-rspec (2.9.0)
87
- rubocop (~> 1.19)
88
- ruby-progressbar (1.11.0)
89
- sshkit (1.21.2)
90
+ rubocop-rspec (2.19.0)
91
+ rubocop (~> 1.33)
92
+ rubocop-capybara (~> 2.17)
93
+ ruby-progressbar (1.13.0)
94
+ sshkit (1.21.4)
90
95
  net-scp (>= 1.1.2)
91
96
  net-ssh (>= 2.8.0)
92
- unicode-display_width (2.1.0)
93
- webmock (3.14.0)
97
+ unicode-display_width (2.4.2)
98
+ webmock (3.18.1)
94
99
  addressable (>= 2.8.0)
95
100
  crack (>= 0.3.2)
96
101
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -103,10 +108,10 @@ DEPENDENCIES
103
108
  capistrano-asg-rolling!
104
109
  rake (~> 13.0)
105
110
  rspec (~> 3.0)
106
- rubocop (~> 1.26.1)
107
- rubocop-performance (~> 1.13.3)
111
+ rubocop (~> 1.50.2)
112
+ rubocop-performance (~> 1.17.0)
108
113
  rubocop-rake (~> 0.6.0)
109
- rubocop-rspec (~> 2.9.0)
114
+ rubocop-rspec (~> 2.19.0)
110
115
  webmock (~> 3.11)
111
116
 
112
117
  BUNDLED WITH
@@ -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.5.0'
29
+ spec.required_ruby_version = '>= 2.6.0'
30
30
 
31
31
  spec.add_development_dependency 'bundler', '~> 2.0'
32
32
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -61,12 +61,12 @@ module Capistrano
61
61
 
62
62
  def snapshots
63
63
  @snapshots ||= aws_ec2_image.block_device_mappings.map do |mapping|
64
- Snapshot.new(mapping.ebs.snapshot_id)
65
- end
64
+ Snapshot.new(mapping.ebs.snapshot_id) if mapping.ebs
65
+ end.compact
66
66
  end
67
67
 
68
68
  def tags
69
- @tags ||= aws_ec2_image.tags.map { |tag| [tag.key, tag.value] }.to_h
69
+ @tags ||= aws_ec2_image.tags.to_h { |tag| [tag.key, tag.value] }
70
70
  end
71
71
 
72
72
  def tag?(key)
@@ -63,6 +63,14 @@ module Capistrano
63
63
  def verbose?
64
64
  fetch(:asg_rolling_verbose)
65
65
  end
66
+
67
+ def rolling_update=(value)
68
+ set(:asg_rolling_update, value)
69
+ end
70
+
71
+ def rolling_update?
72
+ fetch(:asg_rolling_update)
73
+ end
66
74
  end
67
75
  end
68
76
  end
@@ -12,9 +12,10 @@ module Capistrano
12
12
  #
13
13
  class Plugin < Capistrano::Plugin
14
14
  def set_defaults
15
- set_if_empty :asg_rolling_group_name, ENV['asg_name']
15
+ set_if_empty :asg_rolling_group_name, ENV.fetch('asg_name', nil)
16
16
  set_if_empty :asg_rolling_use_private_ip_address, true
17
17
  set_if_empty :asg_rolling_verbose, true
18
+ set_if_empty :asg_rolling_update, true
18
19
  end
19
20
 
20
21
  def register_hooks
@@ -3,7 +3,7 @@
3
3
  module Capistrano
4
4
  module ASG
5
5
  module Rolling
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.1'
7
7
  end
8
8
  end
9
9
  end
@@ -45,7 +45,7 @@ namespace :rolling do
45
45
 
46
46
  desc 'Update Auto Scaling Groups: create AMIs, update Launch Templates and start Instance Refresh'
47
47
  task :update do
48
- unless config.instances.empty?
48
+ if config.rolling_update? && !config.instances.empty?
49
49
  logger.info 'Stopping instance(s)...'
50
50
  config.instances.stop
51
51
 
@@ -121,7 +121,24 @@ namespace :rolling do
121
121
  end
122
122
  else
123
123
  logger.error 'No instances have been launched. Are you using a configuration with rolling deployments?'
124
+ exit 1
125
+ end
126
+ end
127
+
128
+ desc 'Do a test deployment: run the deploy task but do not trigger the update ASG task and do not automatically terminate instances'
129
+ task :deploy_test do
130
+ config.rolling_update = false
131
+
132
+ if config.instances.any?
133
+ config.instances.each do |instance|
134
+ instance.auto_terminate = false
135
+ end
136
+ else
137
+ logger.error 'No instances have been launched. Are you using a configuration with rolling deployments?'
138
+ exit 1
124
139
  end
140
+
141
+ invoke 'deploy'
125
142
  end
126
143
 
127
144
  desc 'Create an AMI from an Instance in the Auto Scaling Groups'
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -180,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - ">="
182
182
  - !ruby/object:Gem::Version
183
- version: 2.5.0
183
+ version: 2.6.0
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - ">="
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.3.7
190
+ rubygems_version: 3.4.1
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Capistrano plugin for performing rolling updates to AWS Auto Scaling Groups