capistrano-twingly 4.0.4 → 4.1.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: 73f8f583d6a2f3186696bf34770d1e625320200e2d214dbf60ab0e9d4e25808a
4
- data.tar.gz: a7a9ca0a5d69e5820e5c2f5cbe19f62711261c4276ab270d34d3114b32c43061
3
+ metadata.gz: afd47e4da563c1ea3af2ba4cedfe12d6a00a3b41f97c86f677b39c8e74f73e32
4
+ data.tar.gz: 59b39f7f78d66d8ff2fdd97bc9c45558c0be8c2f15828d919d69ff105d33ed77
5
5
  SHA512:
6
- metadata.gz: c4f6236ebfe68552a06884bb41637521810e72ff02a9fb2fbc41b6bd4cfdfd3ee4ca9df920434728fdb3866f735419272121f3e102e49fed307d5c45f618feca
7
- data.tar.gz: 96f1ed608d1a6ff88b6f1c2aa617da057412f8e7125cb2a4b75a7218f3c51608f0343544b36da2bcce3b92d910d8f05d90faef2ef6d33c09dc0452c24f947c95
6
+ metadata.gz: 0b73b92f74a51106df9d265027585c633ea577b85eac876f2465f9f20fd3de2d9084f634b1ff902207b7f6b68d807e57a02e3d91b59f996e3d969e621e990c4b
7
+ data.tar.gz: c5fa361fb1b561791060a843055005e8cd26afd85836a6ec9738167d11801223296152cd53115f8bce6c1b39af9f496f9936c24244b5e9cdf4637fdc51dc23fa
@@ -6,15 +6,15 @@ on:
6
6
 
7
7
  jobs:
8
8
  build:
9
- runs-on: ubuntu-18.04
9
+ runs-on: ubuntu-22.04
10
10
 
11
11
  strategy:
12
12
  matrix:
13
- ruby: [2.7.3, 3.0.1, head]
13
+ ruby: [2.7.6, 3.0.4, 3.1.2]
14
14
 
15
15
  steps:
16
16
  - name: Checkout Code
17
- uses: actions/checkout@v2
17
+ uses: actions/checkout@v3
18
18
 
19
19
  - name: Setup Ruby ${{ matrix.ruby }}
20
20
  uses: ruby/setup-ruby@v1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.0.4](https://github.com/twingly/capistrano-twingly/tree/v4.0.4) (2022-06-28)
4
+
5
+ [Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.3...v4.0.4)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Use net-ssh ~\> 7.0 [\#66](https://github.com/twingly/capistrano-twingly/pull/66) ([Pontus4](https://github.com/Pontus4))
10
+ - Run CI on latest Rubies [\#64](https://github.com/twingly/capistrano-twingly/pull/64) ([walro](https://github.com/walro))
11
+ - Ruby 3.0.0 on CI [\#62](https://github.com/twingly/capistrano-twingly/pull/62) ([walro](https://github.com/walro))
12
+
3
13
  ## [v4.0.3](https://github.com/twingly/capistrano-twingly/tree/v4.0.3) (2021-01-14)
4
14
 
5
15
  [Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.2...v4.0.3)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "capistrano-twingly"
7
- spec.version = '4.0.4'
7
+ spec.version = '4.1.0'
8
8
  spec.authors = ["Twingly AB"]
9
9
  spec.email = ["support@twingly.com"]
10
10
  spec.summary = %q{Capistrano 3 tasks used for Twingly's Ruby deployment}
@@ -3,14 +3,25 @@ require 'resolv'
3
3
  SRV_RECORDS = %w[
4
4
  _rubyapps._tcp.sth.twingly.network
5
5
  ]
6
+ FALLBACK_DNS_SERVER = "gateway.sth.twingly.network"
6
7
 
7
- resolver = Resolv::DNS.new
8
+ def lookup_srv_records(resolver: Resolv::DNS.new)
9
+ SRV_RECORDS.map do |srv_record|
10
+ resolver.getresources(srv_record, Resolv::DNS::Resource::IN::SRV)
11
+ end.flatten.map(&:target).map(&:to_s)
12
+ end
13
+
14
+ servers = lookup_srv_records
8
15
 
9
- servers = SRV_RECORDS.map do |srv_record|
10
- resolver.getresources(srv_record, Resolv::DNS::Resource::IN::SRV)
11
- end.flatten.map(&:target).map(&:to_s)
16
+ # Query datacenter gateway directly if local DNS server is unable to find the SRV records
17
+ if servers.empty?
18
+ datacenter_dns_server_address = Resolv.getaddress(FALLBACK_DNS_SERVER)
12
19
 
13
- raise "Can't find any servers, no records for #{SRV_RECORDS}" if servers.empty?
20
+ resolver = Resolv::DNS.new(nameserver: datacenter_dns_server_address)
21
+ servers = lookup_srv_records(resolver: resolver)
22
+
23
+ raise "Can't find any servers, no records for #{SRV_RECORDS}" if servers.empty?
24
+ end
14
25
 
15
26
  set :servers_from_srv_record, servers
16
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-twingly
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.4
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twingly AB
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-28 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano