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 1717import sys
1818import os
1919
20- def run_command (cmd ):
20+ def run_command (cmd , log_file = None ):
2121 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+
2328 (output , err ) = p .communicate ()
2429 return p .wait ()
2530
@@ -53,8 +58,8 @@ def main():
5358 print ("Testing {}" .format (dockerfile ))
5459 log_file = dockerfile .replace (docker_dir ,"" ).replace ("/" , "_" )
5560 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 )
5863 results [dockerfile ] = status
5964 if status != 0 :
6065 suite_status = False
You can’t perform that action at this time.
0 commit comments