consul_kv_backup 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13b187d68d4ff6d1592949f06a38ff5cbb996005799ffb522759f66a4539d26e
4
- data.tar.gz: aa9d14e725256b181d6d70c59718c4dda0c578f3e15faf1b17322ae395b7a89d
3
+ metadata.gz: 9e2faf40012dd1c4ff2cc2c4d07468d1cfec5c0888d3c3e8df17ffbb64ca48ac
4
+ data.tar.gz: 4403cf574540e08900d45977a762c03a45397d05036f1e0f2671f6cc1d6a812d
5
5
  SHA512:
6
- metadata.gz: 239168aeaf537e277db14aa982bc4caf18fb07b95014c0001fd0fdec6ba725fc4951f3a48e1945fea3bffc9cba4e176f10160dafa50b2b9a208a1153aed3411c
7
- data.tar.gz: 64d05b93d3d0fc99eb52f0c87f0d6b2c11179fe900f40bf4a995bf2b1d1c0e5fd1c479c32787d7376e91ae521ca8ef0aca5479ca7df1a5f410662eb2d7bb990d
6
+ metadata.gz: acafce04ab67130c0044693c1ccef9a15d9f7d7c301ee15c9642dfda01361f0f540e3f3ddf65b57c9521998df527db037d932708587902fecf8a248383ecddad
7
+ data.tar.gz: c63d520ed52ba21a3738148723968817fbb09147039860bf9f04ff07490ef5a922ac44b6366712e359055ed2693a64633cca4dcbabfd09f09433d8ff61b2036a
data/Rakefile CHANGED
@@ -55,7 +55,7 @@ task :start_deps do
55
55
  end
56
56
 
57
57
  task up: [:start_deps] do
58
- cmd = 'docker-compose --file test/docker-compose.yml up consul-kv-backup'
58
+ cmd = 'docker-compose --file test/docker-compose.yml up -d consul-kv-backup'
59
59
  _output, _status = FlazmRubyHelpers::Os.exec(cmd)
60
60
  end
61
61
 
@@ -65,7 +65,7 @@ task :down do
65
65
  end
66
66
 
67
67
  task publish: [:build, :docker_build] do
68
- #FlazmRubyHelpers::Project::Git.publish(spec_file.version.to_s, 'origin', 'master')
68
+ FlazmRubyHelpers::Project::Git.publish(spec_file.version.to_s, 'origin', 'master')
69
69
  FlazmRubyHelpers::Project::Docker.publish(spec_file.metadata['docker_image_name'], spec_file.version.to_s)
70
70
  FlazmRubyHelpers::Project::Docker.publish(spec_file.metadata['docker_image_name'], 'latest')
71
71
  FlazmRubyHelpers::Project::Gem.publish(spec_file.name.to_s, spec_file.version.to_s)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -23,7 +23,8 @@ module ConsulKvBackup
23
23
  :topic,
24
24
  @amqp_exchange,
25
25
  durable: true)
26
- @queue = @ch.queue(@amqp_queue, durable: true).bind(@ex, routing_key: @amqp_routing_key)
26
+ @queue = @ch.queue(@amqp_queue, durable: true)
27
+ @queue.bind(@ex, routing_key: @amqp_routing_key) if @amqp_bind
27
28
  end
28
29
 
29
30
  def consume
@@ -35,7 +36,8 @@ module ConsulKvBackup
35
36
 
36
37
  def process_message(delivery_info, properties, body)
37
38
  data = JSON.parse(body)
38
- data['value'] = @consul.consul_key(data['key_path']) if data['new_value']
39
+ dc = data['consul_dc']
40
+ data['value'] = @consul.consul_key(data['key_path'], dc) if data['new_value']
39
41
 
40
42
  @git.process_data(data)
41
43
  end
@@ -71,7 +73,8 @@ module ConsulKvBackup
71
73
  amqp_password: 'guest',
72
74
  amqp_queue: nil,
73
75
  amqp_exchange: "amq.topic",
74
- amqp_routing_key: 'consul_watcher.key.#'
76
+ amqp_routing_key: 'consul_watcher.key.#',
77
+ amqp_bind: false
75
78
  }
76
79
  end
77
80
  end
@@ -13,8 +13,8 @@ module ConsulKvBackup
13
13
  setup_connection
14
14
  end
15
15
 
16
- def consul_key(key_path)
17
- Diplomat::Kv.get(key_path)
16
+ def consul_key(key_path, dc)
17
+ Diplomat::Kv.get(key_path, { dc: dc })
18
18
  end
19
19
 
20
20
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul_kv_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Fortman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2019-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler