Pipeline Triggers

Choose when your pipelines should run

To create an effective CI/CD process, it should be possible to trigger Codefresh pipelines 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 also offers you the capability to trigger them with completely separate mechanisms. You can even skip triggering a pipeline by including predefined flags in the commit message.

Codefresh Trigger Types

Trigger types currently supported by Codefresh are:

As an example, this project contains 4 pipelines:

Sample pipelines

Sample 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.

Default GIT Trigger

Default GIT Trigger

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.

Adding new Trigger dialog

Adding new Trigger dialog

For more information see:

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).

Toggle a trigger on/off

Toggle a trigger on/off

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.

For Git triggers, you can also skip triggering the pipeline without disabling the trigger by adding a predefined string to the commit message. See Skip triggering pipeline on commit.