Open HariSekhon opened 1 year ago
Interested folks can start off by modifying the gitGraph diagram.
Some notes on the syntax.
endparallel
and use intendation like mindmap does to differentiate stages.stage
seems redundant, what if we avoid stage id:
completely, and just use the labels?CIPipeline
"Setup"
parallel "Downloads"
"Download ArgoCD"
"Download Grype"
"Download Kustomize"
"Download Trivy"
parallel "Code Scanning"
"Grype" state: "running"
"Trivy" state: "running"
"GCP Auth"
"Wait for GCP CloudBuild"
"Add GCR Docker Image Tags"
"GCP Docker Auth"
parallel "Container Scanning"
"Grype" state: "failed"
"Trivy" state: "failed"
"ArgoCD Deploy" state: "aborted"
pipeline state: "failed"
Or even more concise
CIPipeline
Setup
Downloads
"Download ArgoCD ❯ unicode"
Download Grype
Download Kustomize
Download Trivy
"Code Scanning ⚠"
Grype
Trivy
GCP Auth
Wait for GCP CloudBuild
Add GCR Docker Image Tags
GCP Docker Auth
Container Scanning
Grype state: failed
Trivy state: failed
ArgoCD Deploy state: aborted
pipeline state: failed
I've updated the original post with some real-world screenshots showing some real variations including:
When trying to use existing gitGraph
for visualizing the required state of a Jenkins pipeline, I noticed more differences that should be kept in mind:
gitGraph
forks on commits. Compare this image from the initial post in this issue:
and this (I tried to reproduce few steps):
%% gitGraph
%% branch " "
%% commit id: "Build bingo-app-server artifact"
%% commit id: "Build bingo-app-regulator artifact"
%% commit id: "Deploy configuration"
%% branch " "
%% checkout " "
%% commit id: "Run migrations"
%% checkout " "
%% commit id: "Check/deploy kafka topics"
%% checkout " "
%% merge " "
%%{init: {'gitGraph': {'showBranches': false}} }%%
gitGraph
commit id: "Start"
commit id: "Setup"
branch l1
branch l2
branch l3
branch l4
branch l5
checkout main
commit id: "Download ArgoCD"
checkout l1
commit id: "Dowload Clairctl"
checkout l2
commit id: "Download Grype"
checkout l3
commit id: "Download Kustomize"
checkout l4
commit id: "Download Trivy"
checkout l5
commit id: "Install NodeJS"
checkout main
merge l1
merge l2
merge l3
merge l4
merge l5
commit id: "Code Scanning"
commit id: "GCP Auth"
branch l6
commit id: "GCP Docker Auth"
commit id: "GCP CloudBuild"
checkout main
merge l6
commit id: "Wait for GCR Docker Images"
branch l7
commit id: "Docker Pull"
checkout main
commit id: "Add GCR Docker Image Tags"
merge l7
branch l8
commit id: "Container Image Scanning"
checkout main
merge l8
commit id: "ArgoCD Deploy"
commit id: "End"
Proposal
Jenkins CI/CD pipeline graph - similar to what GitGraph currently does except:
Use Cases
Demonstrating popular CI/CD workflows and strategies - Jenkins Blue Ocean UI pipeline diagram is currently the gold standard for visualizing this and most widely use - so I want it to look like this.
I would like to be able to create Blue Ocean diagrams in code without having to create the actual pipelines in Jenkins and then take screenshots. That is so last decade.
Please let this become another cool Diagram-as-Code type 🙏🏼
Screenshots
pipeline in progress, some steps failed but ignored eg. code scan
pipeline in progress, some steps skipped:
pipelines completed, some steps failed, other steps skipped:
no changes detected, so Approval not asked for an Apply skipped too:
pipeline Approval stage not approved or timed out, so terraform Apply stage skipped:
More screenshots can be found here along with the Jenkinsfile and Groovy Shared Library code behind all these pipelines:
https://github.com/HariSekhon/Jenkins
More screenshots can be found in my Diagrams-as-Code repo which uses MermaidJS among other diagram languages:
https://github.com/HariSekhon/Diagrams-as-Code
https://github.com/HariSekhon/Diagrams-as-Code/tree/master/screenshots
Code Sample
Doesn't match exactly to the above screenshots, but just to give a flavour of how to handle different pipeline stages.
Any stages without a
state
should besuccess
or not run yet if they are proceeded a stage set torunning
that are not parallel siblings:The same pipeline in progress part way through, where some of the nodes are hollow not executed yet and the currently executing ones are blue glowing orbs: