diff --git a/bin/ci/ci_gantt_chart.py b/bin/ci/ci_gantt_chart.py index 0cd40dde85d..882ab5424b3 100755 --- a/bin/ci/ci_gantt_chart.py +++ b/bin/ci/ci_gantt_chart.py @@ -114,6 +114,12 @@ def parse_args() -> None: description="Generate the Gantt chart from a given pipeline." ) parser.add_argument("pipeline_url", type=str, help="URLs to the pipeline.") + parser.add_argument( + "-o", + "--output", + type=str, + help="Output file name. Use html ou image suffixes to choose the format.", + ) parser.add_argument( "--token", metavar="token", @@ -131,4 +137,10 @@ if __name__ == "__main__": pipeline, _ = get_gitlab_pipeline_from_url(gl, args.pipeline_url) fig = generate_gantt_chart(pipeline) - fig.show() + if args.output and "htm" in args.output: + fig.write_html(args.output) + elif args.output: + fig.update_layout(width=1000) + fig.write_image(args.output) + else: + fig.show() diff --git a/bin/ci/requirements.txt b/bin/ci/requirements.txt index e01c0096543..a1448999b15 100644 --- a/bin/ci/requirements.txt +++ b/bin/ci/requirements.txt @@ -1,6 +1,7 @@ colorama==0.4.5 filecache==0.81 gql==3.4.0 +kaleido==0.2.1 python-dateutil==2.8.2 pandas==2.1.1 plotly==5.17.0