capistrano-hivequeen 7.7.0 → 7.7.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: 72b660b02784362a5c9a2f8a96a3355a3fd18fb399b57d138942488f89b16b10
4
- data.tar.gz: da9503dc5137e661476abba23820112d59bd4033d0775dbd015e449a0ee889f2
3
+ metadata.gz: 8ca77135ec2da064aa528ee926c64e0ff2cf97615aed3a8aa1d72813b3a8fb70
4
+ data.tar.gz: b456eb78e4f914da4fc6a5eaa3a99f0902336c2951b26437d4bf403f44f7bcae
5
5
  SHA512:
6
- metadata.gz: 96e6bb88e860b84984b32501ac7be9135364b4ad16a4a644540e8b3cb9f30e655f20f829b5bdcf085e4fc8ba4ddc54d18cc1f36a9a59bef356de48af5f37080a
7
- data.tar.gz: ca952a870f3db6dafbc36701dcb6708a2902d611fd1abf57783be5607bd3fc0b62523f81ebfd2e7c8f19b45741a549ab7704d79b548c56220185392069bcb6ed
6
+ metadata.gz: 1efcaa3895d677e108d881d3843b3d7a83343218e0d5d3868db439c85d33f0bf038d6ea0f2a31d0e22e5fcd707b23a99c1016d502b0244715ec785c923d6a64f
7
+ data.tar.gz: 97a8ea9475a996d9bb820c0c99bd55fbf7af635b30803e1f7a92ad3c64902bba5153560f49d9fa64486ecf0b6495985b31ae050ed14d19655bcc5c3105219d91
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')
@@ -8,17 +8,21 @@ class HiveQueen
8
8
  end
9
9
 
10
10
  def self.ec2_instance_connect(*private_dns)
11
- # EC2 Instance Connect
11
+ # Get SSH public key contents
12
12
  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
- }
13
+
14
+ # Get SSH bastion instance(s) from Name tag
15
+ ssh_params = { filters: [{ name: 'tag:Name', values: %w[ssh-bastion] }] }
16
+ logger.trace("ec2:DescribeInstances #{ssh_params.to_json}")
17
+ bastions = ec2_client.describe_instances(**ssh_params).reservations.map(&:instances).flatten
18
+
19
+ # Get EC2 instances from private DNS name
20
+ ec2_params = { filters: [{ name: 'network-interface.private-dns-name', values: private_dns }] }
19
21
  logger.trace("ec2:DescribeInstances #{ec2_params.to_json}")
20
22
  instances = ec2_client.describe_instances(**ec2_params).reservations.map(&:instances).flatten
21
- threads = instances.map do |instance|
23
+
24
+ # Collect EC2 Instance Connect request threads
25
+ threads = (bastions + instances).map do |instance|
22
26
  Thread.new do
23
27
  ec2ic_params = {
24
28
  availability_zone: instance.placement.availability_zone,
@@ -31,6 +35,7 @@ class HiveQueen
31
35
  end
32
36
  end
33
37
 
38
+ # Execute EC2 Instance Connect request threads
34
39
  threads.each(&:join)
35
40
  end
36
41
  end
@@ -1,6 +1,6 @@
1
1
  class HiveQueen
2
2
  class Version
3
- @@version = '7.7.0'
3
+ @@version = '7.7.1'
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.1
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-08-01 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
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.3.7
148
+ rubygems_version: 3.1.6
149
149
  signing_key:
150
150
  specification_version: 2
151
151
  summary: Capistrano extensions for interacting with HiveQueen