Pipelines overview
CircleCI pipelines are the highest-level unit of work, and they are described by a configuration file, for example, .circleci/config.yml. Triggers can be set up to automate when a pipeline will be triggered. Pipelines coordinate the execution of workflows and jobs to build, test, and deploy your code. Workflows can be conditional, based on filters, job requirements, and pipeline parameters.
Pipelines include your workflows, which coordinate your jobs. Pipelines have a fixed, linear lifecycle, and are associated with a specific actor. Pipelines trigger when a change is pushed to a project that has a CircleCI configuration file included, and can also be scheduled, triggered manually through the CircleCI app, or using the API.
Dashboard
When visiting your CircleCI dashboard, you are shown a list of recently-triggered pipelines for your organization.
Pipeline architecture
A pipeline is composed of workflows, which are composed of jobs. By navigating from a pipeline to a specific job, you can access your job output, test results, and artifacts through several tabs.
The output of each job can be opened in a new tab (in either raw or formatted styling) with a unique link, making it shareable between team members.
Pipelines and triggers
| The information in this section on pipelines and triggers applies to accounts integrated with the CircleCI GitHub App or GitLab. There are two GitHub integration types, either OAuth or through the GitHub App. To find out which GitHub integration type you have refer to the GitHub App integration page. |
Set up pipelines and triggers to define when and how pipelines are automatically triggered for a project. These triggers may be from external services (custom webhooks), or from commits or tags on a version control system.
Pipelines
Pipelines define units of work that can be run within your projects. Each pipeline defines a config source, which points to the location of a CircleCI configuration file. The config source can be set up to be used when triggering a pipeline. Pipelines can be associated with one or more triggers.
A project can have one or more pipelines. The default config source location is .circleci/config.yml. If you authenticated through the GitHub App, you can set this location to any path to a *.yml file.
When you create a project in CircleCI and connect it to a repository, a pipeline is set up for you automatically, and connected to a config source. The connected configuration file is either a file you commit yourself or one generated by CircleCI based on the code in your project.
Add or edit a pipeline
To add or edit a pipeline, follow these steps:
-
In the CircleCI web app, select Projects in the sidebar.
-
Select the ellipsis next to your project () and choose Project Settings.
-
Select Pipelines in the sidebar.
-
Select Add Pipeline, or, if you wish to edit an existing pipeline select the pencil icon on the right.
-
Complete the form fields and options:
-
Give your pipeline a descriptive name, for example
Run tests and deploy. -
Under Config Source select the platform that matches where your project is set up (for example, GitHub App).
-
Authorize your connection if this is not already showing with a
-
Select your repository
Select the same repository for your pipeline and trigger (described in the following section). There is currently a bug that means that CircleCI will always look for the pipeline in the same repository from which the triggering event was emitted. -
Select a fallback branch to use in case the triggering event does not have a triggering branch. This branch will be used if you trigger this pipeline via a custom webhook.
-
Enter the path to your configuration file relative to the root of your repository. For example,
.circleci/config.yml. If you are integrated through the GitHub App, you can enter any path to a.ymlfile, and the file can have any name you choose.
-
-
Select Save.
Once you have set up a pipeline you need to set up a trigger to connect it to. This is described in the following section.
Triggers
Triggers are rules to define that a pipeline should be run on a given event. A project can have one or more triggers, which are associated with events from a source of change. The most common type of trigger is a VCS event, for example a push to a branch on a GitHub repository, but any system that can emit outbound webhooks can also be set up as a trigger. A trigger can have only one pipeline but a pipeline can have multiple triggers.
A trigger kicks off a pipeline to run the workflows defined in your connected config source.
Add a trigger
To add a trigger for a pipeline, follow these steps:
VS Code extension
If you use Visual Studio Code, you can also monitor and interact with your pipelines directly from VS Code with the official CircleCI extension. The extension allows you to customize which projects and pipelines you want to follow, as well as view job logs and test results, download artifacts, approve, re-run, and debug jobs with SSH, and get notified when your workflows fail or need approval.
The CircleCI VS Code extension is available to download on the VS Code marketplace.
Next steps
Find out more about triggering pipelines in the Triggers Overview.