harbr 0.0.99 → 0.0.100

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: cbffb3011062bde3912b59d39f3920e1ac7e9b3146a30a1328e005db1bf6bd41
4
- data.tar.gz: 1e83520dcb131440bae5c1fef6d25c0859852789ef942bedd3944129a1773065
3
+ metadata.gz: d22a7bf822b74fda8aa42c30c036a00af954c466fb5f9e1f393abe63a052c23e
4
+ data.tar.gz: 147008e9205383db62e42e41a9131048b8826301a5af2047298ecd209bda1e19
5
5
  SHA512:
6
- metadata.gz: 15f772d3739ce48a8faf41ada860b03b67b3730a705ecaec575efccf3505df954be3f14b9d0086c63e5621940e12914d045c3f6624327a43fe40b3592251867d
7
- data.tar.gz: df37941a81158ae00ab144e97a89fc3768ecaf277238e2680e148deabc9db3ba38d22bf0210285fe99050a2349ebb85555e0bb47a212b542714debadf634da7a
6
+ metadata.gz: 3a2c3727cbd6917d3db751835336b54ccf4e9ecddac22e7a84a069e9e485f165ac845d6e3de7fe51f69a2183041c33d403df43c271e1b46baf6893946bb7fe22
7
+ data.tar.gz: 499584156142292512df073f475b26c954b5dbc6c69c9c49434e109ec6e1d6a5c35960abedaeeb7a28ec8ee98bb1c6b59b9fa2273c0b8e559ddab5afba01f932
data/exe/harbr CHANGED
@@ -7,10 +7,10 @@ class HarbrCLI < Thor
7
7
  return puts "No containers available." if containers.empty?
8
8
 
9
9
  # Define headers based on Container attributes
10
- headers = ["Name", "Host Header", "IP", "Port"]
10
+ headers = ["Name", "Host Header", "IP", "Port", "Current Version", "Next Version", "Previous Version"]
11
11
 
12
12
  rows = containers.map do |container|
13
- [container.name, container.host_header, container.ip.nil? ? "127.0.0.1" : container.ip, container.port]
13
+ [container.name, container.host_header, container.ip.nil? ? "127.0.0.1" : container.ip, container.port.to_s, container.current_version, container.next_version, container.previous_version]
14
14
  end
15
15
 
16
16
  table = ::Terminal::Table.new(headings: headers, rows: rows)
@@ -1,7 +1,7 @@
1
1
  module Harbr
2
2
  class Container
3
3
  include Dddr::Entity
4
- attr_accessor :name, :host_header, :ip, :port
4
+ attr_accessor :name, :host_header, :ip, :port,:current_version, :next_version,:previous_version
5
5
 
6
6
  queries do
7
7
  def find_by_header(host_header)
data/lib/harbr/job.rb CHANGED
@@ -56,6 +56,7 @@ module Harbr
56
56
  container.host_header =host
57
57
  container.ip = "127.0.0.1"
58
58
  container.port = port
59
+ container.current_version = 0
59
60
  containers.create(container)
60
61
  else
61
62
  container.port = port
@@ -50,22 +50,16 @@ module Harbr
50
50
  puts "Traefik configuration written to /etc/traefik/harbr.toml"
51
51
  end
52
52
 
53
- def collate_containers(name,host,port)
53
+ def collate_containers(name,port, version)
54
54
 
55
55
  containers = Harbr::Container::Repository.new
56
- container = containers.find_by_header(host)
56
+ container = containers.find_by_name(name)
57
57
 
58
- if container.nil?
59
- container = Harbr::Container.new
60
- container.name = name
61
- container.host_header =host
62
- container.ip = "127.0.0.1"
63
- container.port = port
64
- containers.create(container)
65
- else
66
- container.port = port
67
- containers.update(container)
68
- end
58
+ container.port = port
59
+ container.next_version = version
60
+ contaimer.previous_version = container.current_version
61
+ containers.update(container)
62
+
69
63
  containers.all
70
64
  end
71
65
 
@@ -201,7 +195,7 @@ module Harbr
201
195
  system "ln -sf /etc/sv/harbr/#{name}/next /etc/service/next.#{name}"
202
196
  system "sv restart next.#{name}"
203
197
 
204
- containers = collate_containers("next.#{name}","next.#{manifest.host}",port)
198
+ containers = collate_containers("next.#{name}",port,version)
205
199
  create_traefik_config(containers)
206
200
  end
207
201
 
data/lib/harbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Harbr
4
- VERSION = "0.0.99"
4
+ VERSION = "0.0.100"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.99
4
+ version: 0.0.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke