socotra-build 0.3.31 → 0.3.32
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.
- checksums.yaml +4 -4
- data/lib/socotra-build.rb +3 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c763002d1fec36e0d70e618a07746b9261d20a42
|
|
4
|
+
data.tar.gz: 1267f9134f1ea9efbb39da7e8184c05f572c457d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5e1606a8ab63394012b55f6103b8040c1701bb5958de541684308c85091bf5568adde8e7b5c037e088d3245a5807a18290eab7a4e69e46fa41c0b397571a0ce
|
|
7
|
+
data.tar.gz: 761aa751d8002dfe5b1a7fcfdbaa65d41c52b926ba5bd44ba4a1955f0ccc0cec7842c5ed901b73a98b717592debe55c864224840972af9f0b51dbf037cf4d58a
|
data/lib/socotra-build.rb
CHANGED
|
@@ -51,6 +51,7 @@ def self.get_sanitized_cmd(cmd)
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def self.system_safe(cmd=cmd, cmd_description=cmd_description, error_message=error_message, raise_on_fail=true, log_level="ERROR", log=true, print_command=true, retry_exec=false, timeout=0)
|
|
54
|
+
success = true
|
|
54
55
|
start = Time.now.to_i
|
|
55
56
|
|
|
56
57
|
cmd_sanitized = get_sanitized_cmd(cmd)
|
|
@@ -63,6 +64,7 @@ def self.system_safe(cmd=cmd, cmd_description=cmd_description, error_message=err
|
|
|
63
64
|
if log
|
|
64
65
|
log_out = "logs/#{cmd_description}_out.log"
|
|
65
66
|
log_err = "logs/#{cmd_description}_err.log"
|
|
67
|
+
puts "\tLogs available here: #{cmd_description}_err.log and #{cmd_description}_out.log\n\n"
|
|
66
68
|
else
|
|
67
69
|
log_out = "/dev/null"
|
|
68
70
|
log_err = "/dev/null"
|
|
@@ -72,15 +74,12 @@ def self.system_safe(cmd=cmd, cmd_description=cmd_description, error_message=err
|
|
|
72
74
|
begin
|
|
73
75
|
Timeout::timeout(timeout) do
|
|
74
76
|
Process.wait(pid)
|
|
75
|
-
success = true
|
|
76
77
|
end
|
|
77
78
|
rescue Timeout::Error
|
|
78
79
|
Process.kill('INT', pid)
|
|
79
80
|
success = false
|
|
80
81
|
end
|
|
81
82
|
|
|
82
|
-
puts "\tLogs available here: #{cmd_description}_err.log and #{cmd_description}_out.log\n\n"
|
|
83
|
-
|
|
84
83
|
elapsed = Time.now.to_i - start
|
|
85
84
|
|
|
86
85
|
puts "\t#{cmd_description} took #{elapsed} seconds"
|
|
@@ -95,7 +94,7 @@ def self.system_safe(cmd=cmd, cmd_description=cmd_description, error_message=err
|
|
|
95
94
|
raise "#{log_level}: #{error_message}"
|
|
96
95
|
end
|
|
97
96
|
|
|
98
|
-
return
|
|
97
|
+
return success
|
|
99
98
|
end
|
|
100
99
|
|
|
101
100
|
def self.system_unsafe(cmd)
|