record_store 5.11.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/record_store/changeset.rb +6 -3
- data/lib/record_store/cli.rb +12 -7
- data/lib/record_store/version.rb +1 -1
- data/lib/record_store/zone.rb +2 -2
- data/record_store.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f450801e1929b93095645ce0975dba493e5acc0eb3dd8582fe1e480eeccb285
|
4
|
+
data.tar.gz: 9e6418b616eccdacf8b164a51627fc2ddb2d9c8eb8e233f67b03862642eeaf4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76bccf5594a613fc29f9052596add31a8622f5b0bbdb3cf32a1a46ee6ff91cd1312fd576b8108d86534397ac253bcc61b7fa630be0d1ffb69d5e179b424a4dad
|
7
|
+
data.tar.gz: dc01e786afb99b508b1cd8b2fbb612b2a52741a9c9f12146a0b08189cf2d0d3f9366cefc05f4ba4e1fd190e55612445fc80e2484aaa91bd1f5712a51c13864e2
|
data/CHANGELOG.md
CHANGED
@@ -36,12 +36,15 @@ module RecordStore
|
|
36
36
|
|
37
37
|
attr_reader :current_records, :desired_records, :removals, :additions, :updates, :provider, :zone
|
38
38
|
|
39
|
-
def self.build_from(provider:, zone:)
|
39
|
+
def self.build_from(provider:, zone:, all: false)
|
40
40
|
current_zone = provider.build_zone(zone_name: zone.unrooted_name, config: zone.config)
|
41
41
|
|
42
|
+
current_records = all ? current_zone.all : current_zone.records
|
43
|
+
desired_records = all ? zone.all : zone.records
|
44
|
+
|
42
45
|
new(
|
43
|
-
current_records:
|
44
|
-
desired_records:
|
46
|
+
current_records: current_records,
|
47
|
+
desired_records: desired_records,
|
45
48
|
provider: provider,
|
46
49
|
zone: zone.unrooted_name
|
47
50
|
)
|
data/lib/record_store/cli.rb
CHANGED
@@ -59,13 +59,18 @@ module RecordStore
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
desc 'diff', 'Displays the DNS differences between the zone files in this repo and production'
|
62
|
+
desc 'diff [ZONE ...]', 'Displays the DNS differences between the zone files in this repo and production'
|
63
|
+
option :all, desc: 'Include all records', aliases: '-a', type: :boolean, default: false
|
63
64
|
option :verbose, desc: 'Print records that haven\'t diverged', aliases: '-v', type: :boolean, default: false
|
64
|
-
def diff
|
65
|
-
puts "Diffing #{Zone.defined.count}
|
65
|
+
def diff(*zones)
|
66
|
+
puts "Diffing #{zones.any? ? zones.count : Zone.defined.count} zone(s)"
|
67
|
+
|
68
|
+
all = options.fetch('all')
|
66
69
|
|
67
70
|
Zone.each do |name, zone|
|
68
|
-
|
71
|
+
next unless zones.empty? || zones.include?(name)
|
72
|
+
|
73
|
+
changesets = zone.build_changesets(all: all)
|
69
74
|
|
70
75
|
if !options.fetch('verbose') && changesets.all?(&:empty?)
|
71
76
|
print_and_flush('.')
|
@@ -81,21 +86,21 @@ module RecordStore
|
|
81
86
|
puts '-' * 20
|
82
87
|
puts "Provider: #{changeset.provider}"
|
83
88
|
|
84
|
-
if
|
89
|
+
if changeset.additions.any?
|
85
90
|
puts "Add:"
|
86
91
|
changeset.additions.map(&:record).each do |record|
|
87
92
|
puts " - #{record}"
|
88
93
|
end
|
89
94
|
end
|
90
95
|
|
91
|
-
if
|
96
|
+
if changeset.removals.any?
|
92
97
|
puts "Remove:"
|
93
98
|
changeset.removals.map(&:record).each do |record|
|
94
99
|
puts " - #{record}"
|
95
100
|
end
|
96
101
|
end
|
97
102
|
|
98
|
-
if
|
103
|
+
if changeset.updates.any?
|
99
104
|
puts "Update:"
|
100
105
|
changeset.updates.map(&:record).each do |record|
|
101
106
|
puts " - #{record}"
|
data/lib/record_store/version.rb
CHANGED
data/lib/record_store/zone.rb
CHANGED
@@ -70,10 +70,10 @@ module RecordStore
|
|
70
70
|
@records = build_records(records)
|
71
71
|
end
|
72
72
|
|
73
|
-
def build_changesets
|
73
|
+
def build_changesets(all: false)
|
74
74
|
@changesets ||= begin
|
75
75
|
providers.map do |provider|
|
76
|
-
Changeset.build_from(provider: provider, zone: self)
|
76
|
+
Changeset.build_from(provider: provider, zone: self, all: all)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
data/record_store.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_runtime_dependency 'fog-xml'
|
37
37
|
spec.add_runtime_dependency 'fog-dynect', '~> 0.4.0'
|
38
38
|
spec.add_runtime_dependency 'dnsimple', '~> 4.4.0'
|
39
|
-
spec.add_runtime_dependency 'google-cloud-dns'
|
39
|
+
spec.add_runtime_dependency 'google-cloud-dns', '~> 0.31.0'
|
40
40
|
spec.add_runtime_dependency 'ruby-limiter', '~> 1.0', '>= 1.0.1'
|
41
41
|
spec.add_runtime_dependency 'ns1'
|
42
42
|
spec.add_runtime_dependency 'oci', '~> 2.6.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: record_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-04-
|
12
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -141,16 +141,16 @@ dependencies:
|
|
141
141
|
name: google-cloud-dns
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- - "
|
144
|
+
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
146
|
+
version: 0.31.0
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- - "
|
151
|
+
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
153
|
+
version: 0.31.0
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: ruby-limiter
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -412,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
412
412
|
- !ruby/object:Gem::Version
|
413
413
|
version: '0'
|
414
414
|
requirements: []
|
415
|
-
rubygems_version: 3.0.
|
415
|
+
rubygems_version: 3.0.3
|
416
416
|
signing_key:
|
417
417
|
specification_version: 4
|
418
418
|
summary: Manage DNS using git
|