harbr 0.1.59 → 0.1.61

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/! +51 -0
  3. data/lib/harbr/job.rb +11 -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: 2e56262ec27753fc415e7e48325aec332145488ec6e0e3a689b00157068547ca
4
- data.tar.gz: c8baafeb348d432669ed3364661a13144f8e0a184f5691aec82d9662e981647c
3
+ metadata.gz: c1981cd906aad0aa7276bcf5a4000bca22a4c64c60d5c65fb6035938fc4752af
4
+ data.tar.gz: d1085ae8703b5f65ebed446d75072886df693d6dfa44c64a1dc7170e8794f059
5
5
  SHA512:
6
- metadata.gz: '0339b59014fd96460c44617f351be1303a0c963e15d1e6cb3c308c89368bff436b59f15c6993c2f5df59caba2d8b690f194c0f6b3bff79dc056970ef48b8c091'
7
- data.tar.gz: eba0044d3a43226387a901c2dae9551b9ddb48ac0a3b34f6f519a434795f4aca533c5d14e35982018fabbd8a71d654cffcf4608f7e762c17b125961915cd284b
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
 
@@ -169,15 +169,18 @@ module Harbr
169
169
  `chmod +x /etc/sv/harbr/#{name}/#{env}/run`
170
170
  `chmod +x /etc/sv/harbr/#{name}/#{env}/finish`
171
171
  `chmod +x /etc/sv/harbr/#{name}/#{env}/log/run`
172
+ `mkdir -p /var/log/harbr/#{name}/#{env}`
172
173
  end
173
174
 
174
175
  if env == "current"
175
176
  write_to_file "/etc/sv/harbr/#{name}/run", run_script
176
177
  write_to_file "/etc/sv/harbr/#{name}/log/run", log_script
177
- write_to_file "/etc/sv/harbr/#{name}/log/finish", finish_script
178
+ write_to_file "/etc/sv/harbr/#{name}/finish", finish_script
178
179
  `chmod +x /etc/sv/harbr/#{name}/run`
179
180
  `chmod +x /etc/sv/harbr/#{name}/finish`
180
181
  `chmod +x /etc/sv/harbr/#{name}/log/run`
182
+ `mkdir -p /var/log/harbr/#{name}`
183
+
181
184
  end
182
185
 
183
186
 
@@ -222,21 +225,22 @@ module Harbr
222
225
  exec 2>&1
223
226
  cd /var/harbr/containers/#{@container_name}/#{@env}
224
227
  exec ./exe/run #{@port} #{@env}
228
+ echo "started #{@container_name} on port #{@port}"
225
229
  SCRIPT
226
230
  end
227
231
 
228
232
  def finish_script
229
233
  <<~SCRIPT
230
234
  #!/bin/sh
231
- sleep 1
232
235
  lsof -i :#{@port} | awk 'NR!=1 {print $2}' | xargs kill
233
- sleep 1
236
+ echo "killed #{@container_name} on port #{@port}"
234
237
  SCRIPT
235
238
  end
236
239
 
237
240
  def log_script
238
241
  <<~SCRIPT
239
242
  #!/bin/sh
243
+ echo "starting log for #{@container_name} on port #{@port}"
240
244
  exec svlogd -tt /var/log/harbr/#{@container_name}/#{@env}/
241
245
  SCRIPT
242
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.59"
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.59
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"