harbr 0.0.7 → 0.0.8
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 +4 -4
- data/exe/harbr +16 -9
- 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: 28f2c1235e59113b8c839c9415029ee430dd17a7f5b9faee3c7b87e702d1985c
|
4
|
+
data.tar.gz: 4fb3a9e958c0409d63e04e2430cfb0d5133991e4971fde94f41c9e5b79ecf0f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8982a2e3d0fc1373af022ef5bace65c89fa4113539bc09606e4d58d8cb491b21c4de980638a1543747588230558013fbc1248be62fb50fbe6ece2d0d31d850cf
|
7
|
+
data.tar.gz: ea16bacf0c5a6f444a9cf946443bd01eeea71147cf0e7ffff751c44264c891aa9b0001de094980851d87fc6621562eed0938df2ca76f2911c121bf6a162634bd
|
data/exe/harbr
CHANGED
@@ -18,6 +18,11 @@ class HarbrCLI < Thor
|
|
18
18
|
|
19
19
|
no_commands do
|
20
20
|
|
21
|
+
def extract_container_name(path)
|
22
|
+
match = path.match(/\/var\/harbr\/(?<container_name>.*)\/versions\/\d*\/config\/manifest.yml/)
|
23
|
+
match ? match[:container_name] : nil
|
24
|
+
end
|
25
|
+
|
21
26
|
def display_containers_table(containers)
|
22
27
|
return puts "No containers available." if containers.empty?
|
23
28
|
|
@@ -72,24 +77,26 @@ class HarbrCLI < Thor
|
|
72
77
|
|
73
78
|
puts "Setup completed successfully."
|
74
79
|
end
|
80
|
+
|
75
81
|
desc "start [DIRECTORY]", "Start listening to a directory for changes"
|
76
82
|
def start(directory = DEFAULT_DIRECTORY)
|
77
83
|
return if @@listener
|
78
84
|
|
79
85
|
puts "Starting Harbr, listening to #{directory}"
|
80
|
-
|
86
|
+
|
81
87
|
@@listener = Listen.to(directory) do |modified, added, removed|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
+
job_created = false
|
89
|
+
|
90
|
+
added.each do |path|
|
91
|
+
next if job_created
|
92
|
+
if path.match?(/\/var\/harbr\/.*\/versions\/\d*\/config\/manifest.yml/)
|
93
|
+
container_name = extract_container_name(path)
|
94
|
+
if container_name
|
95
|
+
Harbr::Container::Job.perform_async(container_name)
|
96
|
+
job_created = true
|
88
97
|
end
|
89
|
-
|
90
98
|
end
|
91
99
|
end
|
92
|
-
|
93
100
|
end
|
94
101
|
@@listener.start # not blocking
|
95
102
|
sleep
|
data/lib/harbr/version.rb
CHANGED