commit d57eff3fa2c7f0611f8922e98ed33375a1c0a4e6
parent 3f9ee5122a45246b5ccec5f47c59dab2147d6733
Author: arjoonn sharma <arjoonn@midpathsoftware.com>
Date: Tue, 6 Dec 2022 10:06:52 +0530
allow build and move
Diffstat:
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/jaypore_ci/docker.py b/jaypore_ci/docker.py
@@ -68,11 +68,12 @@ class Docker(Executor):
assert self.pipe_id is not None, "Cannot delete jobs if pipe is not set"
job = None
for job in self.pipeline.jobs:
- self.logging().info(
- "Stop job:",
- subprocess=self.check_output(f"docker stop -t 1 {job.run_id}"),
- )
- job.check_job(with_update_report=False)
+ if job.run_id is not None:
+ self.logging().info(
+ "Stop job:",
+ subprocess=self.check_output(f"docker stop -t 1 {job.run_id}"),
+ )
+ job.check_job(with_update_report=False)
if job is not None:
job.check_job()
self.logging().info("All jobs stopped")
diff --git a/jaypore_ci/jci.py b/jaypore_ci/jci.py
@@ -175,7 +175,7 @@ class Job: # pylint: disable=too-many-instance-attributes
def check_job(self, with_update_report=True):
self.logging().debug("Checking job run")
- if isinstance(self.command, str):
+ if isinstance(self.command, str) and self.run_id is not None:
is_running, exit_code, logs = self.pipeline.executor.get_status(self.run_id)
self.last_check = pendulum.now(TZ)
self.logging().debug(
@@ -260,9 +260,11 @@ class Pipeline: # pylint: disable=too-many-instance-attributes
if job.status == Status.RUNNING:
pipe_status = Status.RUNNING
break
+ service = None
for service in self.services:
service.check_job(with_update_report=False)
- service.check_job()
+ if service is not None:
+ service.check_job()
for job in self.should_pass_called:
if job.is_complete():
pipe_status = job.status