harbr 0.1.73 → 0.1.75

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/harbr/job.rb +20 -13
  3. data/lib/harbr/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2af05eeb95471c30ca49d2044fa8ff37880d14c523781f6570402b9d13a83648
4
- data.tar.gz: c37e3f40874254aa84237dc34558fcaf5c805465cc99b965c552da463871e7a4
3
+ metadata.gz: 435fad22a3618a2b57938a9550bafdc259672ca3379d893317278df466548ec5
4
+ data.tar.gz: 0e723967c914e25962c32d7741ca1cd01226db9dba05c9d6d769f4d397c1a3a8
5
5
  SHA512:
6
- metadata.gz: df8e612c5e99e600126e6a9b8d3467501dbce9dea55a172ae9e9a5d0f8b0c38fae3da4603f526a20b97757bd1524df6bfde729136b5c5429ab6fc20605117e9a
7
- data.tar.gz: b8632e8fe04571fa1981733b0953a0de91bd31dee2f963177667cddbcb55457ea64bd8621af4f9321d476a85a424951075d2510ec96c5060e5f75f317df94e9e
6
+ metadata.gz: 70946062d22034a0a370ed9364cdde7ff9c13855832e405e7955806f768383be95eac3a101b45f43d4f2360f58235209384d1b87128ca72cce16f0cd77f5ebaf
7
+ data.tar.gz: ebffe2fda61381e9bcfccf97c5f430808434bd330c4e96342023c90d9eacf806d7f0036f85471a78181b6e4c8b607c4f22de57d160da4bb8e351c3acedee53af
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) if env == "current"
136
- containers = collate_containers("#{env}.#{name}", "#{env}.#{manifest.host}", port) if env == "next"
142
+ containers = collate_containers("#{name}", "#{manifest.host}", port,manifest.host_header_alias) if env == "current"
143
+ containers = collate_containers("#{env}.#{name}", "#{env}.#{manifest.host}", port,manifest.host_header_alias.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.73"
4
+ VERSION = "0.1.75"
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.73
4
+ version: 0.1.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke