diff --git a/parse-ci.py b/parse-ci.py index 20c63d48798c1fe5e696c44d10d0b95b9cb8c420..712b8e8ef1fdf7c6268f92f34b5ffc896a1ea2be 100644 --- a/parse-ci.py +++ b/parse-ci.py @@ -45,6 +45,8 @@ def get_new_job(info : list[dict]) -> dict: def run_cli_sequential(job : job_data) -> int: exec_location = os.path.join("/usr/src/project/",os.path.relpath(job.location , dir_path)).replace("\\", "/") disallowed = ['/', '\\', '-', '_', '.'] + logfile= job.location.replace("\\", os.sep) + ".log" + f = open(logfile, 'w') output = subprocess.call( \ args= \ @@ -59,8 +61,10 @@ def run_cli_sequential(job : job_data) -> int: "--entrypoint", "sh", \ job.image, \ "-c", - f"chmod +x {exec_location} && {exec_location} || sh {exec_location} || bash {exec_location}"]) - return None, output + f"chmod +x {exec_location} && {exec_location} || sh {exec_location} || bash {exec_location}"], + stdout=f, + stderr=f) + return None, f def listToString(s): # initialize an empty string @@ -128,10 +132,10 @@ def run_ci(compile_info : list[job_data]) -> bool: (job_info,task, output) = job if task is None or task.poll() is not None: job_info.finished = True + output.close() if task is None: job_info.failed = output else: - output.close() job_info.failed = (task.returncode != 0) change = True remove_able_jobs.append(job)