rtyler / jdp

Jenkins Declarative Parser
GNU Lesser General Public License v3.0
32 stars 6 forks source link

Add a `graph` subcommand to the CLI to visualize stage progression #12

Open rtyler opened 3 years ago

rtyler commented 3 years ago

Now that the parser is already having to inspect each stage for correctness, it shouldn't be too much surgery to add a graph subcommand that either prints a stage graph in the CLI or outputs dot format for graphing with Graphviz, e.g.

+-----+     +------+     +--------+
|Build+---> | Test +---> | Deploy |
+-----+     +------+     +--------+

(handling nested stages and parallel obviously, thus the suggestion to just output dot format)

It would be nice if I could pipe this, e.g. jdp graph Jenkinsfile | dot -o pipeline.png

himanoa commented 3 years ago

May I try this?

rtyler commented 3 years ago

@himanoa try to implement it? Go for it :smile: