harbr 0.0.98 → 0.0.100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/harbr +3 -2
- data/lib/harbr/container.rb +1 -1
- data/lib/harbr/job.rb +1 -0
- data/lib/harbr/next/job.rb +8 -14
- 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: d22a7bf822b74fda8aa42c30c036a00af954c466fb5f9e1f393abe63a052c23e
|
4
|
+
data.tar.gz: 147008e9205383db62e42e41a9131048b8826301a5af2047298ecd209bda1e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
@@ -190,6 +190,7 @@ class HarbrCLI < Thor
|
|
190
190
|
`mv rollback current`
|
191
191
|
`cp -r current.bak next`
|
192
192
|
`rm -rf rollback`
|
193
|
+
`rm -rf current.bak`
|
193
194
|
`sv restart #{name}`
|
194
195
|
`sv restart next.#{name}`
|
195
196
|
puts "rollback successful"
|
data/lib/harbr/container.rb
CHANGED
data/lib/harbr/job.rb
CHANGED
data/lib/harbr/next/job.rb
CHANGED
@@ -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,
|
53
|
+
def collate_containers(name,port, version)
|
54
54
|
|
55
55
|
containers = Harbr::Container::Repository.new
|
56
|
-
container = containers.
|
56
|
+
container = containers.find_by_name(name)
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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}",
|
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