11"""Module for cli build commands."""
22from __future__ import annotations
3+
34from typing import List
4- import click
55
6- from cdevents . cli . utils import add_disclaimer_text , print_function_args
6+ import click
77from cdevents .cli .cdevents_command import CDeventsCommand
8+ from cdevents .cli .utils import add_disclaimer_text , print_function_args
9+ from cdevents .core .build import BuildFinishedEvent , BuildQueuedEvent , BuildStartedEvent
810
9- from cdevents .core .build import BuildStartedEvent , BuildQueuedEvent , BuildFinishedEvent
1011
1112# pylint: disable=unused-argument
1213def common_build_options (function ):
@@ -53,11 +54,13 @@ def started(
5354 artifact : str = None ,
5455 data : List [str ] = None ,
5556):
57+ """Creates a BuildStarted CDEvent."""
5658 print_function_args ()
5759 build_event = BuildStartedEvent (id = id , name = name , artifact = artifact , data = data )
5860 cdevents_command = CDeventsCommand ()
5961 cdevents_command .run (build_event )
6062
63+
6164@click .command (help = add_disclaimer_text ("Build Finished CloudEvent." ))
6265@common_build_options
6366def finished (
@@ -66,11 +69,13 @@ def finished(
6669 artifact : str = None ,
6770 data : List [str ] = None ,
6871):
72+ """Creates a BuildFinished CDEvent."""
6973 print_function_args ()
7074 build_event = BuildQueuedEvent (id = id , name = name , artifact = artifact , data = data )
7175 cdevents_command = CDeventsCommand ()
7276 cdevents_command .run (build_event )
7377
78+
7479@click .command (help = add_disclaimer_text ("PipelineRun Queued CloudEvent." ))
7580@common_build_options
7681def queued (
@@ -79,6 +84,7 @@ def queued(
7984 artifact : str = None ,
8085 data : List [str ] = None ,
8186):
87+ """Creates a BuildQueued CDEvent."""
8288 print_function_args ()
8389 build_event = BuildFinishedEvent (id = id , name = name , artifact = artifact , data = data )
8490 cdevents_command = CDeventsCommand ()
0 commit comments