In this article, you will know what a trigger is, its usage, and how to add a trigger to a pipeline. To know more about trigger development, see the Plugins section of the documentation.
What is a Trigger?
A trigger is an initial input that starts off the pipeline execution. It is an event listener such as a webhook catcher. Whenever the event throws a webhook, the trigger catches it and executes the pipeline.
Where are Triggers needed?
Depending on the webhooks, Triggers can listen to any event. A common event example is a code commit into the GIT repository where a CI/CD automation may be evoked. Other events such as monitoring peaks, firewall attacks, etc. can also cause a pipeline to start running.
Adding a Trigger to a pipeline
1. Open the project and pipeline where you want to add the trigger to.
2. In the Design sub-menu, click the Triggers icon to enable the Triggers panel.
3. In the Triggers panel, click the Create New button.
4. The Add trigger window will appear. Specify the Trigger details:
- Name: enter the trigger name.
- Description: enter the trigger description.
5. In the Configuration field, click the drop-down arrow to select the pipeline configuration (link to Configuration header) that you want to use when executing the pipeline.
6. In the Plugin field, click the drop-down arrow to select the trigger that will execute the pipeline.
7. Additional parameter fields will be enabled after selecting the plugin. Define the value of each parameter field before saving the trigger.
8. Click Save to create the trigger.