harbr 0.1.74 → 0.1.76

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: 9877634da31a16119ff1d0e5ecfacdc31f24fde43ad9a7480b35bea64d35e6b1
4
- data.tar.gz: b17a073276840f9ca3afc649890a3fdc9d16a1c79ac8a426b57ec761760ec795
3
+ metadata.gz: 25c59c9cd61adc436961f0e11d942f3beaec172d575016a62e7235bf019dfbbf
4
+ data.tar.gz: 74b4f42440502453f5379168ddbb54bdc9762dca22ee9b21dd40cf1bf72dc3b4
5
5
  SHA512:
6
- metadata.gz: d156312501011ccfdc8e00413de6c4c43abc9ae301cc41ec931b25d63ef5e7c9f2c5609c8a53fe72c9e0bbc340fe35355b5f9ad437584cc57dd20319e63870a3
7
- data.tar.gz: aeec78960e4c368d778238d4517691757017be952f230030da96cebc7fe0b48ea86d48b0101d06d7e8f6b5e592a773adfa98f8fa6f1dd111255c381a61592a31
6
+ metadata.gz: ca464a20f013e23af45ccd3a5415a6692ea251b143d0f7dfb1c3616e39eda0f90aa7186f106a99d77e051d6fb48cb6c478a544eb9d7f892e19cec73094cae634
7
+ data.tar.gz: 96098237e91582858a53a5a4214f9f5683f80965cbcfd8f2567dc7a9e52681c4c2e74442fa3a8fab798ad41c1b4da1096c08902289318e37345e54c92aa43c95
@@ -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, :host_header_aliases
4
+ attr_accessor :name, :host_header, :ip, :port
5
5
 
6
6
  queries do
7
7
  def find_by_header(host_header)
data/lib/harbr/job.rb CHANGED
@@ -42,23 +42,30 @@ module Harbr
42
42
  def collate_containers(name, host, port, host_header_aliases = [])
43
43
  containers = Harbr::Container::Repository.new
44
44
  container = containers.find_by_header(host)
45
-
46
- host_header_aliases << host
47
-
45
+
48
46
  if container.nil?
49
- host_header_aliases.each do |host_header_alias|
50
- container = Harbr::Container.new
51
- container.name = name
52
- container.host_header = host_header_alias
53
- container.ip = "127.0.0.1"
54
- container.port = port
55
- containers.create(container)
56
- end
47
+ container = Harbr::Container.new
48
+ container.name = name
49
+ container.host_header = host
50
+ container.ip = "127.0.0.1"
51
+ container.port = port
52
+ containers.create(container)
53
+
57
54
  else
58
55
  container.port = port
59
56
  containers.update(container)
60
57
  end
61
58
 
59
+ host_header_aliases.each do |host_header_alias|
60
+ container = Harbr::Container.new
61
+ container.name = "#{name} -> #{host_header_alias}"
62
+ container.host_header = host_header_alias
63
+ container.ip = "127.0.0.1"
64
+ container.port = port
65
+ containers.create(container) unless containers.find_by_header(host_header_alias)
66
+ end
67
+
68
+
62
69
  containers.all
63
70
  end
64
71
 
@@ -132,8 +139,8 @@ module Harbr
132
139
  link_directories(name, version, env)
133
140
  sync_live_data_if_next(name) if env == "next"
134
141
 
135
- containers = collate_containers("#{name}", "#{manifest.host}", port,manifest.host_header_alias) if env == "current"
136
- containers = collate_containers("#{env}.#{name}", "#{env}.#{manifest.host}", port,manifest.host_header_alias.map{|host| "#{env}.#{host}" }) if env == "next"
142
+ containers = collate_containers("#{name}", "#{manifest.host}", port,manifest.host_aliases) if env == "current"
143
+ containers = collate_containers("#{env}.#{name}", "#{env}.#{manifest.host}", port,manifest.host_aliases&.map{|host| "#{env}.#{host}" }) if env == "next"
137
144
 
138
145
  create_traefik_config(containers)
139
146
 
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.1.74"
4
+ VERSION = "0.1.76"
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.1.74
4
+ version: 0.1.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke