harbr 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/harbr +10 -2
- 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: 32e7b196f83512a92b8fb0a25d9fbdd52ba5c78e6825d7e5898f2f71124f4e62
|
4
|
+
data.tar.gz: 35af73a51a9a86ee40029493f64faeb334b615588c7d6c3dd5070044892dbc52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fd5d61269812db09f34c94a9fdb8c58f18d3c135875cec2ddd6413c3bdb3b1cda9d579c3379065d18ef0b71b55d635154e12bd8544415ecc0b2745ae574edd8
|
7
|
+
data.tar.gz: c0d23c242765bc5ab84a0cdb8634966c1c1fc35ccdaa21d5ec1d3202d43067d75af6eabc635001da3f191dd28d25134910edfc4f04b6c7198cf7b7c7814d27c9
|
data/exe/harbr
CHANGED
@@ -3,6 +3,12 @@ require_relative "../lib/harbr"
|
|
3
3
|
|
4
4
|
class HarbrCLI < Thor
|
5
5
|
no_commands do
|
6
|
+
def highest_numbered_directory(path)
|
7
|
+
directories = Dir.glob("#{path}/*").select { |entry| File.directory?(entry) }
|
8
|
+
directories.max_by { |entry| entry[/\d+/].to_i }
|
9
|
+
end
|
10
|
+
|
11
|
+
|
6
12
|
def display_containers_table(containers)
|
7
13
|
return puts "No containers available." if containers.empty?
|
8
14
|
|
@@ -172,8 +178,10 @@ class HarbrCLI < Thor
|
|
172
178
|
desc "deploy", "deploy a container to production"
|
173
179
|
def deploy(name)
|
174
180
|
Dir.chdir("/var/harbr/containers/#{name}/") do
|
175
|
-
`
|
176
|
-
|
181
|
+
/(?<next>. * -> (?<path>.*))/.match(`ls -l /var/harbr/containers/#{name}/next`)
|
182
|
+
`rm -r current`
|
183
|
+
`ln -sf #{$2} current`
|
184
|
+
`sv restart #{name}`
|
177
185
|
end
|
178
186
|
end
|
179
187
|
|
data/lib/harbr/version.rb
CHANGED