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 +4 -4
- data/lib/harbr/container.rb +1 -1
- data/lib/harbr/job.rb +20 -13
- data/lib/harbr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25c59c9cd61adc436961f0e11d942f3beaec172d575016a62e7235bf019dfbbf
|
4
|
+
data.tar.gz: 74b4f42440502453f5379168ddbb54bdc9762dca22ee9b21dd40cf1bf72dc3b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca464a20f013e23af45ccd3a5415a6692ea251b143d0f7dfb1c3616e39eda0f90aa7186f106a99d77e051d6fb48cb6c478a544eb9d7f892e19cec73094cae634
|
7
|
+
data.tar.gz: 96098237e91582858a53a5a4214f9f5683f80965cbcfd8f2567dc7a9e52681c4c2e74442fa3a8fab798ad41c1b4da1096c08902289318e37345e54c92aa43c95
|
data/lib/harbr/container.rb
CHANGED
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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.
|
136
|
-
containers = collate_containers("#{env}.#{name}", "#{env}.#{manifest.host}", port,manifest.
|
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