Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipelines #8893

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jekyll/_cci2/github-apps-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ Project roles give control over which users have access to which projects within
For a complete list of permissions, see the xref:roles-and-permissions-overview#[Roles and permissions overview] page.

[#configuration]
=== Configuration sources and project triggers
=== Pipelines and triggers

You can add or delete configuration sources and triggers for your project. For details see the xref:pipelines#configuration-sources-and-project-triggers[pipelines overview].
You can add or delete pipelines and triggers for your project. For details see the xref:pipelines#pipelines-and-triggers[pipelines overview].

[#project-settings-advanced]
=== Advanced
Expand Down
20 changes: 10 additions & 10 deletions jekyll/_cci2/gitlab-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GitLab CI/CD integration with CircleCI introduces the concept of "standalone" pr

Follow the steps on the xref:first-steps#gitlab[Sign up and try CircleCI] page to connect your GitLab account, which creates your CircleCI organization.

NOTE: You will need API access and write permissions on the repository you want to set up. Within GitLab, this is the maintainer role or higher.
NOTE: You will need API access and write permissions on the repository you want to set up. Within GitLab, this is the "maintainer" role or higher.

[.tab.signup.GitLab_SaaS]
--
Expand Down Expand Up @@ -92,15 +92,15 @@ Follow the steps on the **Create New Project** page:

image::{{site.baseurl}}/assets/img/docs/gl-sm-create-project.png[Create a new project in a self-managed org]

. Enter your self-managed instance URL. The field will automatically append `/api/v4`, so the URL that CircleCI uses to connect to your account looks something like `https://test-gitlab.circleci.com/api/v4`. Click **Verify**.
. Enter your self-managed instance URL. The field will automatically append `/api/v4`, so the URL that CircleCI uses to connect to your account looks something like `https://test-gitlab.circleci.com/api/v4`. Select **Verify**.

. Enter your personal access token. Click **Connect**.
. Enter your personal access token. Select **Connect**.

. Copy and paste the SSH host key from your self-managed instance into **known_hosts**. Click **Connect**.
. Copy and paste the SSH host key from your self-managed instance into **known_hosts**. Select **Connect**.

. Once your account is successfully authorized, select the repository for your CircleCI project, and enter a project name.

. Finally, click **Create Project**. You will then be redirected to the newly-created project's Pipelines page.
. Finally, select **Create Project**. You will then be redirected to the newly-created project's Pipelines page.

The express CircleCI configuration setup is not currently available for GitLab Self-managed projects. You will need to add a `.circleci/config.yml` file in your repository if it has not yet been set up. If the repository you selected already contains a `.circleci/config.yml`, you will need to save a commit in the repository to see your pipeline on the dashboard.
--
Expand Down Expand Up @@ -162,9 +162,9 @@ Project roles give control over which users have access to which projects within
For a complete list of permissions, see the xref:roles-and-permissions-overview#[Roles and permissions overview] page.

[#configuration]
=== Configuration sources and project triggers
=== Pipelines and triggers

You can add or delete configuration sources and triggers for your project. For details see the xref:pipelines#configuration-sources-and-project-triggers[pipelines overview].
You can add or delete pipelines and triggers for your project. For details see the xref:pipelines#pipelines-and-triggers[pipelines overview].

[#project-settings-advanced]
=== Advanced
Expand All @@ -186,9 +186,9 @@ When creating a GitLab-based project in CircleCI, an SSH key is created, which i
ssh-keygen -t ed25519 -C "your_email@example.com"
```

. Go to your project on link:https://gitlab.com/[GitLab] and navigate to **Settings > Repository**, and expand the **Deploy keys** section. Enter a title in the "Title" field, then copy and paste the public key you created in step 1. Check **Grant write permissions to this key** box, then click **Add key**.
. Go to your project on link:https://gitlab.com/[GitLab] and navigate to **Settings > Repository**, and expand the **Deploy keys** section. Enter a title in the "Title" field, then copy and paste the public key you created in step 1. Check **Grant write permissions to this key** box, then select **Add key**.

. Go to your project settings in the CircleCI app, select **SSH Keys**, and **Add SSH key**. In the "Hostname" field, enter `gitlab.com` and add the private key you created in step 1. Then click **Add SSH Key**.
. Go to your project settings in the CircleCI app, select **SSH Keys**, and **Add SSH key**. In the "Hostname" field, enter `gitlab.com` and add the private key you created in step 1. Then select **Add SSH Key**.

. In your `.circleci/config.yml` file, add the fingerprint to a job using the `add_ssh_keys` key:
+
Expand All @@ -213,7 +213,7 @@ For more information on SSH keys, refer to the xref:add-ssh-key#[Adding an SSH k

For GitLab integrations, organizations and users are managed independently from your VCS. Organizations and users are considered CircleCI organizations and users, with their own roles and permissions that do not rely on those defined in your VCS.

To manage settings at the organization level, click btn:[Organization Settings] in the CircleCI web app sidebar.
To manage settings at the organization level, select btn:[Organization Settings] in the CircleCI web app sidebar.

[#organization-settings-people]
=== People
Expand Down
70 changes: 35 additions & 35 deletions jekyll/_cci2/pipelines.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,67 +32,67 @@ The output of each job can be opened in a new tab (in either raw or formatted st

image::/docs/assets/img/docs/pipelines-job-output.png[Download and share job step output]

== Configuration sources and project triggers
== Pipelines and triggers

NOTE: The information in this section on configuration sources and triggers applies to accounts integrated with the xref:github-apps-integration#[CircleCI GitHub App] or xref:gitlab-integration#[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 xref:github-apps-integration#[GitHub App integration] page.
NOTE: The information in this section on pipelines and triggers applies to accounts integrated with the xref:github-apps-integration#[CircleCI GitHub App] or xref:gitlab-integration#[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 xref:github-apps-integration#[GitHub App integration] page.

Set up configuration sources and project 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.
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.

=== Configuration source
=== Pipelines

Configuration sources define the units of work that can be run within your projects. Each configuration source defines the location of a pipeline configuration file, and can be set up to be used when _triggering_ a pipeline. Configuration sources can be associated with one or more triggers.
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 configuration sources. The default location for a CircleCI configuration file is `.circleci/config.yml`. If you authenticated through the GitHub App, you can set the location to _any_ path to a `*.yml` file.
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 configuration source is set up for you automatically, and connected to a configuration file. The connected configuration file will be either a file you commit yourself or one generated by CircleCI based on the code in your project.
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.

image::{{site.baseurl}}/assets/img/docs/project-settings-configuration.png[Configuration source]
image::project-settings-pipelines.png[Pipelines page in project settings]

==== Add a configuration source
==== Add a pipeline

TIP: If you created a project xref:create-project#[in the CircleCI web app] you will find a configuration source is already set up.
TIP: If you created a project xref:create-project#[in the CircleCI web app] you will find a pipeline is already set up.

image::{{site.baseurl}}/assets/img/docs/add-configuration-source.png[Add a configuration source]
image::add-pipeline.png[Add a pipeline]

To add a configuration source, follow these steps:
To add a pipeline, follow these steps:

. In the CircleCI web app, select **Projects** in the sidebar.
. Select the ellipsis next to your project (icon:ellipsis-h[]) and choose **Project Settings**.
. Select **Configuration** in the sidebar.
. Select btn:[Add Configuration Source].
. Select **Pipelines** in the sidebar.
. Select btn:[Add Pipeline].
. Complete the form fields and options:
** Give your configuration source a descriptive name, for example `Run tests and deploy`.
** Under Configuration Source select the platform that matches where your project is set up (for example, GitHub App).
** 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).
+
NOTE: For GitLab Self-managed, you can input any instance that you have previously set up in CircleCI. If you wish to set a different feature branch or repository from a self-managed instance as a new configuration source, you will first need to add a new connection via your xref:gitlab-integration#organization-settings-integrations[menu:Organization Settings[Integrations]]. In either case, you will also need to enter your personal access token again to authorize this connection.
NOTE: For GitLab Self-managed, you can input any instance that you have previously set up in CircleCI. If you wish to set a different feature branch or repository from a self-managed instance as a new pipeline, you will first need to add a new connection via your xref:gitlab-integration#organization-settings-integrations[menu:Organization Settings[Integrations]]. In either case, you will also need to enter your personal access token again to authorize this connection.
** Authorize your connection if this is not already showing with a icon:check-circle[]
** Select your repository
+
CAUTION: **Select the same repository for your configuration source and trigger** (described in the following section). There is currently a bug that means that CircleCI will always look for the configuration source in the same repository from which the triggering event was emitted.
CAUTION: **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 `.yml` file, and the file can have any name you choose.
. Select btn:[Save].

Once you have set up a configuration source you need to set up a project trigger to connect it to. This is described in the following section.
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.

=== Project triggers
=== Triggers

TIP: If you created a project xref:create-project#[in the CircleCI web app] you will find a trigger is already set up.

Triggers are rules to define that a configuration source 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 pipeline trigger. A trigger can have only one configuration source but a configuration source can have multiple 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 by your connected configuration source.
A trigger kicks off a pipeline to run the workflows defined in your connected config source.

==== Add a project trigger
==== Add a trigger

To add a project trigger for a configuration source, follow these steps:
To add a trigger for a pipeline, follow these steps:

[.tab.trigger.Custom_webhook]
--

Setting up a custom webhook trigger allows you to trigger pipelines from external services. Any service that can emit a webhook or make a cURL request can be set up in this way to trigger a pipeline. For more information, see the xref:triggers-overview#trigger-a-pipeline-from-a-custom-webhook[Triggers overview] page.

To add a project trigger for a custom webhook, follow these steps:
To add a trigger for a custom webhook, follow these steps:

{% include snippets/custom-webhook-setup.adoc %}

Expand All @@ -104,20 +104,20 @@ To verify your trigger is set up correctly, trigger an event from your third par

When the CircleCI GitHub App is installed for your organization, GitHub starts to send events for the repositories you have granted access to. CircleCI listens for push and tag events. When a trigger is created CircleCI has enough information to use the event data to determine if a pipeline should be triggered.

image::{{site.baseurl}}/assets/img/docs/add-project-trigger.png[Add a project trigger]
image::{{site.baseurl}}/assets/img/docs/add-trigger.png[Add a trigger]

To add a project trigger for a configuration source, follow these steps:
To add a trigger for a pipeline, follow these steps:

. In the link:https://app.circleci.com/[CircleCI web app] select **Projects** in the sidebar
. Find your project in the list, select the ellipsis (icon:ellipsis-h[]) next to it and choose **Project Settings**.
. Select **Triggers** in the sidebar.
. Select btn:[Add Trigger].
. Select the same location in the "Connect to" dropdown menu that you selected for your configuration source (for example, GitHub App).
. Select the same location in the "Connect to" dropdown menu that you selected for your pipeline (for example, GitHub App).
. Select btn:[Next].
. Complete the form fields and options:
** Give your trigger a descriptive name.
** Authorize your connection if this is not already showing with a icon:check-circle[].
** Choose your configuration source from the "Choose config to run" menu.
** Choose your pipeline from the "Choose pipeline to run" menu.
. Select btn:[Save].

To verify your trigger is set up correctly, trigger an event from your repository.
Expand All @@ -128,25 +128,25 @@ To verify your trigger is set up correctly, trigger an event from your repositor

When a trigger is created, CircleCI registers a webhook with GitLab. Push events from GitLab are sent to CircleCI. CircleCI then uses the event data to determine _if_ a pipeline should run, and if so, _which_ pipeline should be run.

In addition to a configuration source, each trigger includes the webhook URL, and in this scenario, a CircleCI-created GitLab token. The webhook URL and GitLab token are used to securely register the webhook within GitLab in order to receive push events from your GitLab repository. You can view webhooks for a project in GitLab at menu:Settings[Webhooks].
In addition to a pipeline, each trigger includes the webhook URL, and in this scenario, a CircleCI-created GitLab token. The webhook URL and GitLab token are used to securely register the webhook within GitLab in order to receive push events from your GitLab repository. You can view webhooks for a project in GitLab at menu:Settings[Webhooks].

image::{{site.baseurl}}/assets/img/docs/add-project-trigger.png[Add a project trigger]
image::{{site.baseurl}}/assets/img/docs/add-trigger.png[Add a trigger]

To add a project trigger for a configuration source, follow these steps:
To add a trigger for a pipeline, follow these steps:

. In the link:https://app.circleci.com/[CircleCI web app] select **Projects** in the sidebar
. Find your project in the list, select the ellipsis (icon:ellipsis-h[]) next to it and choose **Project Settings**.
. Select **Triggers** in the sidebar.
. Select btn:[Add Trigger].
. Select the same location in the "Connect to" dropdown menu that you selected for your configuration source (for example, GitLab).
. Select the same location in the "Connect to" dropdown menu that you selected for your pipeline (for example, GitLab).
. Select btn:[Next].
. Complete the form fields and options:
** Give your trigger a descriptive name.
** Authorize your connection if this is not already showing with a icon:check-circle[] (Not required for custom webhooks).
+
NOTE: For GitLab self-managed you can enter the URL for an instance you have previously set up with CircleCI. You will need to enter the relevant personal access token again here to authorize the connection.
** Select your repository from the dropdown menu. This should match the repository your configuration source is connected to (Not required for custom webhooks).
** Choose your configuration source from the "Choose config to run" menu.
** Select your repository from the dropdown menu. This should match the repository your pipeline is connected to (not required for custom webhooks).
** Choose your pipeline from the "Choose config to run" menu.
** (Optional) You can configure <<user-content-trigger-filters,trigger filters>>.
. Select btn:[Save]
+
Expand Down
Loading