socotra-build 0.2.1 → 0.2.2
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-update.rb +1 -1
- data/lib/socotra-build.rb +6 -2
- 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: dcc8f54e5a0fa8d25f4fdc61ae8db038c9b044ec
|
|
4
|
+
data.tar.gz: dec28dc6c5360b0f22c0959ba857287f5acde016
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3083bc4bae6f972c7972403eccf47f8d92fb3ec1a8ae91d580a6bdbbfb1de696d5dfa7905cae023c8d0e3772c599f6433b0bf01398279ef25078b27bedd4dfbc
|
|
7
|
+
data.tar.gz: 9262be6ddbe83816eb4b6737c532a38cbab5a889d4ffabaa1df02216a18e43b510b22cc52265be9182d9e9fc85a6502ef88a301bd71a71af38cf723385e87dfd
|
data/lib/socotra-build-update.rb
CHANGED
|
@@ -5,7 +5,7 @@ BEGIN {
|
|
|
5
5
|
|
|
6
6
|
if version_installed != version_to_install
|
|
7
7
|
gem_install_output = `gem install socotra-build -v #{version_to_install}`
|
|
8
|
-
files_in_module = `gem contents socotra-build`.split
|
|
8
|
+
files_in_module = `gem contents socotra-build -v #{version_to_install}`.split
|
|
9
9
|
files_in_module.each do |module_file|
|
|
10
10
|
unless module_file.include? "socotra-build-update.rb"
|
|
11
11
|
load module_file
|
data/lib/socotra-build.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require 'open3'
|
|
2
2
|
|
|
3
|
-
def self.safe_retry(cmd, description, error_message="command failed", raise_on_fail=true, tries=3)
|
|
3
|
+
def self.safe_retry(cmd, description, error_message="command failed", raise_on_fail=true, log_level="ERROR", log=true, tries=3)
|
|
4
4
|
begin
|
|
5
|
-
status, output = system_safe(cmd, description, error_message, raise_on_fail=raise_on_fail, log_level=
|
|
5
|
+
status, output = system_safe(cmd, description, error_message, raise_on_fail=raise_on_fail, log_level=log_level, log=log)
|
|
6
6
|
rescue
|
|
7
7
|
if (tries -= 1) > 0
|
|
8
8
|
puts "\n#{cmd} failed, retry attempt #{tries}\n"
|
|
@@ -22,6 +22,8 @@ end
|
|
|
22
22
|
def self.system_safe(cmd, cmd_description, error_message, raise_on_fail=true, log_level="ERROR", log=true)
|
|
23
23
|
if log
|
|
24
24
|
puts "executing command: #{cmd}\n"
|
|
25
|
+
else
|
|
26
|
+
puts "<command contains secret>"
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
start = Time.now.to_i
|
|
@@ -32,6 +34,8 @@ def self.system_safe(cmd, cmd_description, error_message, raise_on_fail=true, lo
|
|
|
32
34
|
File.open("logs/#{cmd_description}_out.log" , 'w') { |file| file.write(stdout) }
|
|
33
35
|
File.open("logs/#{cmd_description}_err.log" , 'w') { |file| file.write(stderr) }
|
|
34
36
|
puts "\tLogs available here: #{cmd_description}_err.log and #{cmd_description}_out.log\n\n"
|
|
37
|
+
else
|
|
38
|
+
puts "Not logging due to secrets in output"
|
|
35
39
|
end
|
|
36
40
|
|
|
37
41
|
puts "\t#{cmd_description} took #{elapsed} seconds"
|