capistrano-hivequeen 7.7.0 → 7.7.2

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: 72b660b02784362a5c9a2f8a96a3355a3fd18fb399b57d138942488f89b16b10
4
- data.tar.gz: da9503dc5137e661476abba23820112d59bd4033d0775dbd015e449a0ee889f2
3
+ metadata.gz: cbc758d62e2ed6b55d9595a7afc5ffa694e6aa2f76bde859a36d44380960f009
4
+ data.tar.gz: 6f4ba43b6a19a9f93b950aadcfa39fefdb442ed2455728f1e7277d0cbb3ebff9
5
5
  SHA512:
6
- metadata.gz: 96e6bb88e860b84984b32501ac7be9135364b4ad16a4a644540e8b3cb9f30e655f20f829b5bdcf085e4fc8ba4ddc54d18cc1f36a9a59bef356de48af5f37080a
7
- data.tar.gz: ca952a870f3db6dafbc36701dcb6708a2902d611fd1abf57783be5607bd3fc0b62523f81ebfd2e7c8f19b45741a549ab7704d79b548c56220185392069bcb6ed
6
+ metadata.gz: 013b9d5bfa2a6e8d923dbe37a1d0b600dbb652aac1c2a3027b1fe17cb884a84af37d1781dfda9c4ad5f123d9b3ad3db087909fb3132e9a247f90e267e4afd281
7
+ data.tar.gz: 293fe44f13d0c942cd5458f2d45e0c40840bd7cbe1cb06e2eb410db29e906dc9ce7a2f778e12a50e2d13047f23742cd30e2b4737f17f145efdbb96bc4d96d025
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ .ruby-version
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  ## that are needed for an end user to actually USE your code.
41
41
  s.add_dependency('aws-sdk-ec2', '~> 1.0')
42
42
  s.add_dependency('aws-sdk-ec2instanceconnect', '~> 1.0')
43
- s.add_dependency('capistrano', '>= 2.11.0')
43
+ s.add_dependency('capistrano', '~> 2.11')
44
44
  s.add_dependency('activesupport', '>= 3.0.0')
45
45
  s.add_dependency('json')
46
46
  s.add_dependency('egads', '>= 3.0.0')
@@ -4,21 +4,28 @@ class HiveQueen
4
4
  end
5
5
 
6
6
  def self.ec2_instance_connect_client
7
- @ec2_instance_connect_client ||= Aws::EC2InstanceConnect::Client.new
7
+ @ec2_instance_connect_client ||= Aws::EC2InstanceConnect::Client.new(
8
+ retry_limit: 5,
9
+ retry_backoff: -> (c) { sleep(5) },
10
+ )
8
11
  end
9
12
 
10
13
  def self.ec2_instance_connect(*private_dns)
11
- # EC2 Instance Connect
14
+ # Get SSH public key contents
12
15
  ssh_public_key = File.read(File.expand_path('~/.ssh/ksr_ed25519.pub'))
13
- ec2_params = {
14
- filters: [{
15
- name: 'network-interface.private-dns-name',
16
- values: private_dns
17
- }]
18
- }
16
+
17
+ # Get SSH bastion instance(s) from Name tag
18
+ ssh_params = { filters: [{ name: 'tag:Name', values: %w[ssh-bastion] }] }
19
+ logger.trace("ec2:DescribeInstances #{ssh_params.to_json}")
20
+ bastions = ec2_client.describe_instances(**ssh_params).reservations.map(&:instances).flatten
21
+
22
+ # Get EC2 instances from private DNS name
23
+ ec2_params = { filters: [{ name: 'network-interface.private-dns-name', values: private_dns }] }
19
24
  logger.trace("ec2:DescribeInstances #{ec2_params.to_json}")
20
25
  instances = ec2_client.describe_instances(**ec2_params).reservations.map(&:instances).flatten
21
- threads = instances.map do |instance|
26
+
27
+ # Collect EC2 Instance Connect request threads
28
+ threads = (bastions + instances).map do |instance|
22
29
  Thread.new do
23
30
  ec2ic_params = {
24
31
  availability_zone: instance.placement.availability_zone,
@@ -31,6 +38,7 @@ class HiveQueen
31
38
  end
32
39
  end
33
40
 
41
+ # Execute EC2 Instance Connect request threads
34
42
  threads.each(&:join)
35
43
  end
36
44
  end
@@ -1,6 +1,6 @@
1
1
  class HiveQueen
2
2
  class Version
3
- @@version = '7.7.0'
3
+ @@version = '7.7.2'
4
4
 
5
5
  def self.to_s
6
6
  @@version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-hivequeen
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.7.0
4
+ version: 7.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-28 00:00:00.000000000 Z
11
+ date: 2022-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-ec2
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: capistrano
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.11.0
47
+ version: '2.11'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.11.0
54
+ version: '2.11'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement