File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 17
17
import sys
18
18
import os
19
19
20
- def run_command (cmd ):
20
+ def run_command (cmd , log_file = None ):
21
21
print ("Running: {}" .format (cmd ))
22
- p = subprocess .Popen (cmd , shell = True )
22
+ if log_file :
23
+ file = open (log_file , "w" )
24
+ p = subprocess .Popen (cmd , shell = True , stdout = file , stderr = file )
25
+ else :
26
+ p = subprocess .Popen (cmd , shell = True )
27
+
23
28
(output , err ) = p .communicate ()
24
29
return p .wait ()
25
30
@@ -53,8 +58,8 @@ def main():
53
58
print ("Testing {}" .format (dockerfile ))
54
59
log_file = dockerfile .replace (docker_dir ,"" ).replace ("/" , "_" )
55
60
log_file = "{}.log" .format (log_file )
56
- cmd = "docker build --no-cache=true {} &> {} " .format (dockerfile , log_file )
57
- status = run_command (cmd )
61
+ cmd = "docker build --no-cache=true {}" .format (dockerfile )
62
+ status = run_command (cmd , log_file )
58
63
results [dockerfile ] = status
59
64
if status != 0 :
60
65
suite_status = False
You can’t perform that action at this time.
0 commit comments