In this example, you first configure a Gerrit listener, then you use that listener in a Gerrit trigger with two events on three different pipelines.
Prerequisites
- Verify that you are a member of a project in Automation Pipelines. If you are not, ask a Automation Pipelines administrator to add you as a member of a project. See How do I add a project in Automation Pipelines.
- Verify that you have a Gerrit endpoint configured in Automation Pipelines. See How do I integrate Automation Pipelines with Gerrit.
- Verify that you know your Gerrit release version.
- For pipelines to trigger, verify that you set the input properties of the pipeline as Gerrit, which allows the pipeline to receive the Gerrit parameters as inputs when the pipeline runs.
For information about input parameters, see Planning a CICD native build in Automation Pipelines before manually adding tasks.
Procedure
Results
What to do next
After you commit a code change in the Gerrit project, observe the Activity tab for the Gerrit event in Automation Pipelines. Verify that the list of activities includes entries that correspond to every pipeline execution in the trigger configuration.
When an event occurs, only pipelines in the Gerrit trigger that relate to the particular type of event can run. In this example, if a patch set is created, only the Gerrit-Trigger-Pipeline and the Gerrit-Demo-Pipeline will run.
- The Change Subject and Execution columns are empty when the trigger was a direct Git push.
- The Trigger for Gerrit column displays the trigger that created the event.
- The Listener column is turned off by default. When you select it, the column displays the Gerrit listener that received the event. A single listener can appear as associated with multiple triggers.
- The Trigger Type column is turned off by default. When you select it, the column displays the type of trigger as AUTOMATIC or MANUAL.
- Other columns include Commit Time, Change#, Status, Message, Action taken, User, Gerrit project, Branch, and Event.
To control the activity for a completed or failed pipeline run, click the three dots at the left of any entry on the Activity screen.
- If the pipeline fails to run because of a mistake in the pipeline model or another problem, correct the mistake and select Re-run, which runs the pipeline again.
- If the pipeline fails to run because of a network connectivity issue or another problem, select Resume, which restarts the same pipeline execution, and saves run time.
- Use View Execution, which opens the pipeline execution view. See How do I run a pipeline and see results.
- Use Delete to delete the entry from the Activity screen.