lex-health 0.1.4 → 0.1.5

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: e0666c974d9ce06c57ee9b600f7d65878327f1d5e806e6d27a1856167f7f9610
4
- data.tar.gz: 85b0476bed965b4c9aea6afa245fe054cb044cfef396ca960c2c66eb9dc363c9
3
+ metadata.gz: 85c20c15c909246e2db7095731a7e612ae85774ee213f20551b14e25ddaa10e9
4
+ data.tar.gz: 803eb25ae8ef49107402cbc64a942888a2fca16f97238910773c32c1f2befdfa
5
5
  SHA512:
6
- metadata.gz: 2800dd3c7d31d133f11f0f3cad9a897ec63ad01016b23d195287fbf5965df7cebd203193de878cb7264293b557a202a63bec7e78f4f7ce0f9200a336f740d749
7
- data.tar.gz: af82fae1cdc2d55dab73f7356f3e783e2e0352720175f2a6c50cff053092f34a4ef47f6fc34f318cf684aeb615097044c747a68342f6888f17f59a64a19b1ff5
6
+ metadata.gz: e203fbab722e67a7d003a691184ba1fa4e61a03a77ae3b6ec99f8ac247b3704aaf21c0430f749e68e20400bdc7f4bb30dc6e19100ac5c4044c86f0bf88080348
7
+ data.tar.gz: 255941157ba3c6fae1b807876b7d34ff04894cd2f4ec6b097a71b263fe213a6fdd1b3e0744b7de61c870278902ef6ab2179817598dfaa95ebc542d8e75f596ea
data/.rubocop.yml CHANGED
@@ -12,9 +12,6 @@ Layout/SpaceAroundEqualsInParameterDefault:
12
12
  EnforcedStyle: space
13
13
  Style/SymbolArray:
14
14
  Enabled: true
15
- Layout/HashAlignment:
16
- EnforcedHashRocketStyle: table
17
- EnforcedColonStyle: table
18
15
  Style/Documentation:
19
16
  Enabled: false
20
17
  AllCops:
data/Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
- FROM ruby:2.7-alpine
1
+ FROM legionio/legion:latest
2
2
  LABEL maintainer="Matthew Iverson <matthewdiverson@gmail.com>"
3
3
 
4
- RUN mkdir /etc/legionio
5
- RUN apk update && apk add build-base postgresql-dev mysql-client mariadb-dev tzdata gcc git
4
+ RUN apk update && apk add build-base tzdata postgresql-dev mysql-client mariadb-dev tzdata gcc git
6
5
 
7
6
  COPY . ./
8
- RUN gem install legionio legion-data mysql2 tzinfo-data tzinfo --no-document --no-prerelease
9
- RUN gem install lex-health --no-document --no-prerelease
10
- CMD legionio
7
+ RUN gem install lex-health legion-data --no-document --no-prerelease
8
+ CMD ruby $(which legionio)
data/Gemfile.lock CHANGED
@@ -6,17 +6,14 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.1)
10
- codecov (0.2.15)
11
- simplecov (>= 0.15, < 0.21)
9
+ ast (2.4.2)
12
10
  diff-lcs (1.4.4)
13
- docile (1.3.5)
14
11
  parallel (1.20.1)
15
12
  parser (3.0.0.0)
16
13
  ast (~> 2.4.1)
17
14
  rainbow (3.0.0)
18
15
  rake (13.0.3)
19
- regexp_parser (2.0.3)
16
+ regexp_parser (2.1.1)
20
17
  rexml (3.2.4)
21
18
  rspec (3.10.0)
22
19
  rspec-core (~> 3.10.0)
@@ -27,11 +24,11 @@ GEM
27
24
  rspec-expectations (3.10.1)
28
25
  diff-lcs (>= 1.2.0, < 2.0)
29
26
  rspec-support (~> 3.10.0)
30
- rspec-mocks (3.10.1)
27
+ rspec-mocks (3.10.2)
31
28
  diff-lcs (>= 1.2.0, < 2.0)
32
29
  rspec-support (~> 3.10.0)
33
- rspec-support (3.10.1)
34
- rubocop (1.8.1)
30
+ rspec-support (3.10.2)
31
+ rubocop (1.11.0)
35
32
  parallel (~> 1.10)
36
33
  parser (>= 3.0.0.0)
37
34
  rainbow (>= 2.2.2, < 4.0)
@@ -40,26 +37,18 @@ GEM
40
37
  rubocop-ast (>= 1.2.0, < 2.0)
41
38
  ruby-progressbar (~> 1.7)
42
39
  unicode-display_width (>= 1.4.0, < 3.0)
43
- rubocop-ast (1.4.0)
40
+ rubocop-ast (1.4.1)
44
41
  parser (>= 2.7.1.5)
45
- rubocop-rspec (2.1.0)
42
+ rubocop-rspec (2.2.0)
46
43
  rubocop (~> 1.0)
47
44
  rubocop-ast (>= 1.1.0)
48
45
  ruby-progressbar (1.11.0)
49
- simplecov (0.20.0)
50
- docile (~> 1.1)
51
- simplecov-html (~> 0.11)
52
- simplecov_json_formatter (~> 0.1)
53
- simplecov-html (0.12.3)
54
- simplecov_json_formatter (0.1.2)
55
46
  unicode-display_width (2.0.0)
56
47
 
57
48
  PLATFORMS
58
49
  ruby
59
50
 
60
51
  DEPENDENCIES
61
- bundler
62
- codecov
63
52
  lex-health!
64
53
  rake
65
54
  rspec
@@ -67,4 +56,4 @@ DEPENDENCIES
67
56
  rubocop-rspec
68
57
 
69
58
  BUNDLED WITH
70
- 2.1.4
59
+ 2.2.6
@@ -16,4 +16,6 @@ pipelines:
16
16
  name: Push to Docker
17
17
  deployment: Docker
18
18
  script:
19
+ - 'apt-get update'
20
+ - 'apt-get install -y docker-ce'
19
21
  - './docker_deploy.rb'
data/lex-health.gemspec CHANGED
@@ -24,11 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
25
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
26
  end
27
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
27
  spec.require_paths = ['lib']
29
28
 
30
- spec.add_development_dependency 'bundler'
31
- spec.add_development_dependency 'codecov'
32
29
  spec.add_development_dependency 'rake'
33
30
  spec.add_development_dependency 'rspec'
34
31
  spec.add_development_dependency 'rubocop'
@@ -9,15 +9,15 @@ module Legion::Extensions::Health
9
9
  return { success: insert(hostname: hostname, **opts), hostname: hostname, **opts } if item.nil?
10
10
 
11
11
  if opts.key?(:timestamp) && !item.values[:updated].nil? && item.values[:updated] > Time.parse(opts[:timestamp])
12
- return { success: false,
13
- reason: 'entry already updated',
14
- hostname: hostname,
12
+ return { success: false,
13
+ reason: 'entry already updated',
14
+ hostname: hostname,
15
15
  db_updated: item.values[:updated],
16
16
  **opts }
17
17
  end
18
18
 
19
19
  {
20
- success: item.update(active: 1, status: opts[:status], name: hostname, updated: Sequel::CURRENT_TIMESTAMP),
20
+ success: item.update(active: 1, status: opts[:status], name: hostname, updated: Sequel::CURRENT_TIMESTAMP),
21
21
  hostname: hostname,
22
22
  **opts
23
23
  }
@@ -18,9 +18,9 @@ module Legion::Extensions::Health
18
18
  )
19
19
  .where(active: true)
20
20
  .each do |node|
21
- Legion::Transport::Messages::NodeHealth.new(status: 'unknown',
22
- node_id: node.values[:id],
23
- hostname: node.values[:name],
21
+ Legion::Transport::Messages::NodeHealth.new(status: 'unknown',
22
+ node_id: node.values[:id],
23
+ hostname: node.values[:name],
24
24
  timestamp: node.values[:updated]).publish
25
25
  nodes.push(node.values[:id])
26
26
  end
@@ -8,9 +8,9 @@ module Legion::Extensions::Health
8
8
 
9
9
  def queue_options
10
10
  {
11
- arguments: {
11
+ arguments: {
12
12
  'x-single-active-consumer': true,
13
- 'x-dead-letter-exchange': 'node.dlx'
13
+ 'x-dead-letter-exchange': 'node.dlx'
14
14
  },
15
15
  auto_delete: false
16
16
  }
@@ -1,7 +1,7 @@
1
1
  module Legion
2
2
  module Extensions
3
3
  module Health
4
- VERSION = '0.1.4'.freeze
4
+ VERSION = '0.1.5'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-health
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miverson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: codecov
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: rake
43
15
  requirement: !ruby/object:Gem::Requirement