harbr 0.1.60 → 0.1.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/! +51 -0
  3. data/lib/harbr/job.rb +8 -7
  4. data/lib/harbr/version.rb +1 -1
  5. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 440d1e8837aa9a47180c1de066f99ea28a572c5455856a04cd4e92d0b663f502
4
- data.tar.gz: 198967d2d4450023705023e3332e1f85ea5da524944440e41d2983d8e9fbe85b
3
+ metadata.gz: c1981cd906aad0aa7276bcf5a4000bca22a4c64c60d5c65fb6035938fc4752af
4
+ data.tar.gz: d1085ae8703b5f65ebed446d75072886df693d6dfa44c64a1dc7170e8794f059
5
5
  SHA512:
6
- metadata.gz: ff337dca9b6cb7084f19d89974dfad16b833bcd0a71c190cdfc86edf93d555d6a6857cfce8c33f59664d170e00ae1681063c845c9b1b0f16f7f924d2cdcd07a1
7
- data.tar.gz: 4c6501fe96e399e5fa466f6219f3b3519228e3f6a285b2a47ce9330591b4acff6e6a7d3a5c3fde9610c6cf302b6a2639f1183b18b3bf817c6ce0cba460911708
6
+ metadata.gz: 16cc4ec3fb5e405eaf03c472336913f5be3ae8071aaf95c3379a2bd124219164f8b66588729117c24c2d94508ee4c9f8085b19774c1ab8793956d4fe1b4a7523
7
+ data.tar.gz: acd9c634875e20c3b0a8bacc14e4f91ebfc68f6ae799306e481eed2799bdf77d5f228714df79d61f46246b33161b534db62a41b1614f725be055701b1b2e38a1
data/! ADDED
@@ -0,0 +1,51 @@
1
+ release 0.1.60
2
+
3
+ add logging and fix finisg script
4
+ # Please enter the commit message for your changes. Lines starting
5
+ # with '#' will be ignored, and an empty message aborts the commit.
6
+ #
7
+ # On branch main
8
+ # Your branch is up to date with 'origin/main'.
9
+ #
10
+ # Changes to be committed:
11
+ # modified: lib/harbr/job.rb
12
+ # modified: lib/harbr/version.rb
13
+ #
14
+ # ------------------------ >8 ------------------------
15
+ # Do not modify or remove the line above.
16
+ # Everything below it will be ignored.
17
+ diff --git a/lib/harbr/job.rb b/lib/harbr/job.rb
18
+ index 747fa75..6ece813 100644
19
+ --- a/lib/harbr/job.rb
20
+ +++ b/lib/harbr/job.rb
21
+ @@ -169,15 +169,18 @@ module Harbr
22
+ `chmod +x /etc/sv/harbr/#{name}/#{env}/run`
23
+ `chmod +x /etc/sv/harbr/#{name}/#{env}/finish`
24
+ `chmod +x /etc/sv/harbr/#{name}/#{env}/log/run`
25
+ + `mkdir -p /var/log/harbr/#{name}/#{env}`
26
+ end
27
+
28
+ if env == "current"
29
+ write_to_file "/etc/sv/harbr/#{name}/run", run_script
30
+ write_to_file "/etc/sv/harbr/#{name}/log/run", log_script
31
+ - write_to_file "/etc/sv/harbr/#{name}/log/finish", finish_script
32
+ + write_to_file "/etc/sv/harbr/#{name}/finish", finish_script
33
+ `chmod +x /etc/sv/harbr/#{name}/run`
34
+ `chmod +x /etc/sv/harbr/#{name}/finish`
35
+ `chmod +x /etc/sv/harbr/#{name}/log/run`
36
+ + `mkdir -p /var/log/harbr/#{name}`
37
+ +
38
+ end
39
+
40
+
41
+ diff --git a/lib/harbr/version.rb b/lib/harbr/version.rb
42
+ index 89cc745..88176bf 100644
43
+ --- a/lib/harbr/version.rb
44
+ +++ b/lib/harbr/version.rb
45
+ @@ -1,5 +1,5 @@
46
+ # frozen_string_literal: true
47
+
48
+ module Harbr
49
+ - VERSION = "0.1.59"
50
+ + VERSION = "0.1.60"
51
+ end
data/lib/harbr/job.rb CHANGED
@@ -123,8 +123,8 @@ module Harbr
123
123
 
124
124
  version_path = "/var/harbr/containers/#{name}/versions/#{version}"
125
125
 
126
- system "sv stop #{env}.#{name}" if env == "next"
127
- system "sv stop #{name}" if env == "current"
126
+ #system "sv stop #{env}.#{name}" if env == "next"
127
+ #system "sv stop #{name}" if env == "current"
128
128
 
129
129
  bundle_install_if_needed(version_path)
130
130
 
@@ -137,8 +137,8 @@ module Harbr
137
137
 
138
138
  create_traefik_config(containers)
139
139
 
140
- system "sv start #{env}.#{name}" if env == "next"
141
- system "sv start #{name}" if env == "current"
140
+ system "sv restart #{env}.#{name}" if env == "next"
141
+ system "sv restart #{name}" if env == "current"
142
142
 
143
143
 
144
144
 
@@ -180,7 +180,7 @@ module Harbr
180
180
  `chmod +x /etc/sv/harbr/#{name}/finish`
181
181
  `chmod +x /etc/sv/harbr/#{name}/log/run`
182
182
  `mkdir -p /var/log/harbr/#{name}`
183
-
183
+
184
184
  end
185
185
 
186
186
 
@@ -225,21 +225,22 @@ module Harbr
225
225
  exec 2>&1
226
226
  cd /var/harbr/containers/#{@container_name}/#{@env}
227
227
  exec ./exe/run #{@port} #{@env}
228
+ echo "started #{@container_name} on port #{@port}"
228
229
  SCRIPT
229
230
  end
230
231
 
231
232
  def finish_script
232
233
  <<~SCRIPT
233
234
  #!/bin/sh
234
- sleep 1
235
235
  lsof -i :#{@port} | awk 'NR!=1 {print $2}' | xargs kill
236
- sleep 1
236
+ echo "killed #{@container_name} on port #{@port}"
237
237
  SCRIPT
238
238
  end
239
239
 
240
240
  def log_script
241
241
  <<~SCRIPT
242
242
  #!/bin/sh
243
+ echo "starting log for #{@container_name} on port #{@port}"
243
244
  exec svlogd -tt /var/log/harbr/#{@container_name}/#{@env}/
244
245
  SCRIPT
245
246
  end
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.60"
4
+ VERSION = "0.1.61"
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.60
4
+ version: 0.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke
@@ -132,6 +132,7 @@ executables:
132
132
  extensions: []
133
133
  extra_rdoc_files: []
134
134
  files:
135
+ - "!"
135
136
  - ".data/development/Harbr::Port.dir"
136
137
  - ".data/development/Harbr::Port.pag"
137
138
  - ".rspec"