harbr 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/harbr +10 -2
  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: f9c8544c1daf62daab459ca9f4d2953b5ad688b8856571326cea06fd486272b6
4
- data.tar.gz: 2979d7301cd49b3477f38ab0293e37045027cb1d469731378132c2dc4cc59b3c
3
+ metadata.gz: 32e7b196f83512a92b8fb0a25d9fbdd52ba5c78e6825d7e5898f2f71124f4e62
4
+ data.tar.gz: 35af73a51a9a86ee40029493f64faeb334b615588c7d6c3dd5070044892dbc52
5
5
  SHA512:
6
- metadata.gz: ceaf8c984d22e2e7e8faf87519601eefbafc8a598caae1e817ce6db6900bc12e2e0b2f20138459f78eaec423eb0f587ba828cbef292586b9ab4835070e2bcbad
7
- data.tar.gz: 469ccc69aa021a4f141596dad901c2af9f386f44b2c9724843c5cb79690b1301065b9ac015c34873445d4afdb6f1e4011f96625b6c0f94feef93ad90e9977800
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
- `mv next current`
176
- puts `sv restart next.#{name}`
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Harbr
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke