Pipeline Triggers
Choose when your pipelines should run
To create an effective CI/CD process, it should be possible to trigger a Codefresh pipeline execution not only on code repository events (like push
or PR
), but also on any “interesting” CD-related event, coming from some external system.
Codefresh not only allows you to define different pipelines on a single project but it also offers you the capability to trigger them with completely separate mechanisms.
Codefresh Trigger Types
Trigger types currently supported by Codefresh are:
- Git Triggers
- Dockerhub Triggers
- Azure Registry Triggers
- Quay Triggers
- Helm Triggers
- Artifactory Triggers
- Cron Trigger
- API/CLI Trigger
As an example, this project contains 4 pipelines:
Behind the scenes these pipelines are triggered from different events:
- Pipeline “CI-build” is using a GIT trigger and starts after every commit to the code repository
- Pipeline “Sonarcloud” is executed every weekend using a cron (timed) trigger
- Pipeline “integration-test” is executed whenever a commit happens in a Pull request on the code
- Pipeline “deploy-prod-k8s” is executed whenever a Docker image is pushed to the Docker registry
This is just an example. You are free to create your own triggers that match your own internal process. It is also possible to add multiple triggers for a pipeline so that it is executed for more than one type of events.
If a pipeline has no defined trigger you can still start it manually.
For all trigger types you can also use the Codefresh CLI to manage them.
Creating a new trigger for a pipeline
By default, when you create a new project from a GIT provider it will start with a GIT trigger that runs on every commit.
You can either delete this trigger, modify it, or add new ones.
To add a new trigger, go to the Triggers tab in your pipeline editor and click the Add Trigger button. This will bring up the respective dialog where you are adding a new trigger.
For more information see:
- Git Triggers
- Dockerhub Triggers
- Azure Registry Triggers
- Quay Triggers
- Helm Triggers
- Artifactory Triggers
- Cron Trigger
Disabling triggers
You can easily disable a trigger manually if you don’t want to be active anymore. On the triggers tab click the gear icon on the top right (Open advanced options).
Then click the toggle switch on each trigger that you want to enable/disable. You can later enable the same trigger again by clicking the same switch.