Jaypore CI

> Jaypore CI: Minimal, Offline, Local CI system.
Log | Files | Refs | README

commit 37160aa9b3bcf0f804cb060ca5d964a4aa55daa2
parent bc06a7e636bc01f6a55951c86e18e75fe3880b42
Author: arjoonn sharma <arjoonn@midpathsoftware.com>
Date:   Tue,  6 Dec 2022 15:54:05 +0530

arrow changes to better show seq / parallel

Diffstat:
Mjaypore_ci/docker.py | 2+-
Mjaypore_ci/gitea.py | 2++
Mjaypore_ci/jci.py | 7++++++-
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/jaypore_ci/docker.py b/jaypore_ci/docker.py @@ -68,7 +68,7 @@ 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: - if job.run_id is not None: + if job.run_id is not None and not job.run_id.startswith("pyrun_"): self.logging().info( "Stop job:", subprocess=self.check_output(f"docker stop -t 1 {job.run_id}"), diff --git a/jaypore_ci/gitea.py b/jaypore_ci/gitea.py @@ -30,7 +30,9 @@ class Gitea(Remote): # pylint: disable=too-many-instance-attributes .decode() .strip() ) + os.environ["JAYPORE_COMMIT_BRANCH"] = branch sha = subprocess.check_output("git rev-parse HEAD", shell=True).decode().strip() + os.environ["JAYPORE_COMMIT_SHA"] = sha owner = Path(remote.path).parts[1] repo = Path(remote.path).parts[2].replace(".git", "") token = os.environ["JAYPORE_GITEA_TOKEN"] diff --git a/jaypore_ci/jci.py b/jaypore_ci/jci.py @@ -234,6 +234,8 @@ class Pipeline: # pylint: disable=too-many-instance-attributes self.executor = executor if executor is not None else docker.Docker() self.graph_direction = graph_direction self.executor.set_pipe_id(id(self), self) + # --- + self.seq_links = set() def logging(self): return logger.bind( @@ -309,7 +311,9 @@ graph {self.graph_direction} } for a, b in edges: - arrow = "-.->" + arrow = "-.-" + if (a, b) in self.seq_links: + arrow = "==>" mermaid += f""" {ref[a]}({a.name}):::{st_map[a.status]} {arrow} {ref[b]}({b.name}):::{st_map[b.status]}""" mermaid += """ @@ -466,6 +470,7 @@ graph {self.graph_direction} if last_job is not None: last_job.children.append(job) job.parents.append(last_job) + self.seq_links.add((last_job, job)) last_job = job # final chain job timeout = (