on_container 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/on_container/dev/setup_ops.rb +20 -9
- data/lib/on_container/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eed50e20955f44cedd05bbe573a86af912f532c709b947c08830f7accb9fec87
|
4
|
+
data.tar.gz: 736ca61c1c66875fa3873432fa8e5c9d452a15f9ae3ce4deef051914a4b838e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24bb727cfe9cd0c052befbda70a4979c2f2d38e26268480eb62c12638b7911e76a98e11873d3479551098705ee369493123869aa31d2cd8b69c4f53852f89182
|
7
|
+
data.tar.gz: c7b5fcb41cf3415183c237ab68a155e4f4dcf3f5c75dc2276f536a31cb7c64cb90520666ba630b212295e5b02bd842a46d6065a52220593e19ecdfcfa2aa36b7
|
@@ -4,25 +4,37 @@ module OnContainer
|
|
4
4
|
module Dev
|
5
5
|
module SetupOps
|
6
6
|
APP_PATH = File.expand_path '.'
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def
|
11
|
-
|
7
|
+
TRUEISH_VALUES = %w[true True TRUE yes Yes YES].freeze
|
8
|
+
SKIP_SETUP_ENV_VAR = 'ON_CONTAINER_SKIP_SETUP_LOCK'.freeze
|
9
|
+
|
10
|
+
def app_temp_path
|
11
|
+
"#{APP_PATH}/tmp"
|
12
|
+
end
|
13
|
+
|
14
|
+
def app_setup_wait
|
15
|
+
ENV.fetch('APP_SETUP_WAIT', '5').to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
def app_setup_lock_path
|
19
|
+
"#{app_temp_path}/setup.lock"
|
20
|
+
end
|
21
|
+
|
12
22
|
def lock_setup
|
13
23
|
system "mkdir -p #{app_temp_path} && touch #{app_setup_lock_path};"
|
14
24
|
end
|
15
|
-
|
25
|
+
|
16
26
|
def unlock_setup
|
17
27
|
system "rm -rf #{app_setup_lock_path}"
|
18
28
|
end
|
19
|
-
|
29
|
+
|
20
30
|
def wait_setup
|
21
31
|
puts 'Waiting for app setup to finish...'
|
22
32
|
sleep app_setup_wait
|
23
33
|
end
|
24
34
|
|
25
35
|
def on_setup_lock_acquired
|
36
|
+
return yield if TRUEISH_VALUES.include? ENV[SKIP_SETUP_ENV_VAR]
|
37
|
+
|
26
38
|
wait_setup while File.exist?(app_setup_lock_path)
|
27
39
|
|
28
40
|
lock_setup
|
@@ -32,7 +44,6 @@ module OnContainer
|
|
32
44
|
end
|
33
45
|
|
34
46
|
yield
|
35
|
-
|
36
47
|
ensure
|
37
48
|
unlock_setup
|
38
49
|
end
|
@@ -42,7 +53,7 @@ module OnContainer
|
|
42
53
|
rails rspec sidekiq hutch puma rake webpack webpack-dev-server
|
43
54
|
].include?(ARGV[0])
|
44
55
|
end
|
45
|
-
|
56
|
+
|
46
57
|
def command_might_require_database?
|
47
58
|
%w[
|
48
59
|
rails rspec sidekiq hutch puma rake
|
data/lib/on_container/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: on_container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Quintanilla
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|