diff options
Diffstat (limited to 'doc/ci/pipelines')
-rw-r--r-- | doc/ci/pipelines/cicd_minutes.md | 8 | ||||
-rw-r--r-- | doc/ci/pipelines/downstream_pipelines.md | 61 | ||||
-rw-r--r-- | doc/ci/pipelines/index.md | 15 | ||||
-rw-r--r-- | doc/ci/pipelines/merge_request_pipelines.md | 21 | ||||
-rw-r--r-- | doc/ci/pipelines/merge_trains.md | 2 | ||||
-rw-r--r-- | doc/ci/pipelines/merged_results_pipelines.md | 2 | ||||
-rw-r--r-- | doc/ci/pipelines/pipeline_architectures.md | 2 | ||||
-rw-r--r-- | doc/ci/pipelines/pipeline_efficiency.md | 2 | ||||
-rw-r--r-- | doc/ci/pipelines/schedules.md | 5 | ||||
-rw-r--r-- | doc/ci/pipelines/settings.md | 3 |
10 files changed, 93 insertions, 28 deletions
diff --git a/doc/ci/pipelines/cicd_minutes.md b/doc/ci/pipelines/cicd_minutes.md index 6c7b00c827a..4e822cf3edd 100644 --- a/doc/ci/pipelines/cicd_minutes.md +++ b/doc/ci/pipelines/cicd_minutes.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# Compute quota **(PREMIUM)** +# Compute quota **(PREMIUM ALL)** > [Renamed](https://gitlab.com/groups/gitlab-com/-/epics/2150) from "CI/CD minutes" to "compute quota" or "compute minutes" in GitLab 16.1. @@ -152,7 +152,7 @@ For example, with a GitLab SaaS Premium license: If you use `13,000` compute minutes during the month, the next month your additional compute minutes become `2,000`. If you use `9,000` compute minutes during the month, your additional compute minutes remain the same. -If you bought additional compute minutes while on a trial subscription, those compute minutes are available after the trial ends or you upgrade to a paid plan. +Additional compute minutes bought on a trial subscription are available after the trial ends or upgrading to a paid plan. You can find pricing for additional compute minutes on the [GitLab Pricing page](https://about.gitlab.com/pricing/). @@ -269,8 +269,10 @@ GitLab SaaS runners have different cost factors, depending on the runner type (L | Linux OS amd64 | small | 1 | | Linux OS amd64 | medium | 2 | | Linux OS amd64 | large | 3 | +| Linux OS amd64 | xlarge | 6 | +| Linux OS amd64 | 2xlarge | 12 | | Linux OS amd64 + GPU-enabled | medium, GPU standard | 7 | -| macOS M1 | Medium | 6 | +| macOS M1 | medium | 6 (Beta) | | Windows Server | - | 1 (Beta) | ### Monthly reset of compute usage diff --git a/doc/ci/pipelines/downstream_pipelines.md b/doc/ci/pipelines/downstream_pipelines.md index 686020fc17a..fca6e8407ef 100644 --- a/doc/ci/pipelines/downstream_pipelines.md +++ b/doc/ci/pipelines/downstream_pipelines.md @@ -4,7 +4,7 @@ group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- -# Downstream pipelines **(FREE)** +# Downstream pipelines **(FREE ALL)** A downstream pipeline is any GitLab CI/CD pipeline triggered by another pipeline. Downstream pipelines run independently and concurrently to the upstream pipeline @@ -209,8 +209,9 @@ To trigger a child pipeline from a dynamically generated configuration file: - generated-config.yml ``` -1. Configure the trigger job to run after the job that generated the configuration file, - and set `include: artifact` to the generated artifact: +1. Configure the trigger job to run after the job that generated the configuration file. + Set `include: artifact` to the generated artifact, and set `include: job` to + the job that created the artifact: ```yaml child-pipeline: @@ -381,7 +382,7 @@ trigger_job: ::EndTabs -### View multi-project pipelines in pipeline graphs **(PREMIUM)** +### View multi-project pipelines in pipeline graphs **(PREMIUM ALL)** After you trigger a multi-project pipeline, the downstream pipeline displays to the right of the [pipeline graph](index.md#visualize-pipelines). @@ -389,7 +390,51 @@ to the right of the [pipeline graph](index.md#visualize-pipelines). In [pipeline mini graphs](index.md#pipeline-mini-graphs), the downstream pipeline displays to the right of the mini graph. -## Fetch artifacts from an upstream pipeline **(PREMIUM)** +## Fetch artifacts from an upstream pipeline **(PREMIUM ALL)** + +::Tabs + +:::TabTitle Parent-child pipeline + +Use [`needs:pipeline:job`](../yaml/index.md#needspipelinejob) to fetch artifacts from an +upstream pipeline: + +1. In the upstream pipeline, save the artifacts in a job with the [`artifacts`](../yaml/index.md#artifacts) + keyword, then trigger the downstream pipeline with a trigger job: + + ```yaml + build_artifacts: + stage: build + script: + - echo "This is a test artifact!" >> artifact.txt + artifacts: + paths: + - artifact.txt + + deploy: + stage: deploy + trigger: + include: + - local: path/to/child-pipeline.yml + variables: + PARENT_PIPELINE_ID: $CI_PIPELINE_ID + ``` + +1. Use `needs:pipeline:job` in a job in the downstream pipeline to fetch the artifacts. + + ```yaml + test: + stage: test + script: + - cat artifact.txt + needs: + - pipeline: $PARENT_PIPELINE_ID + job: build_artifacts + ``` + + Set `job` to the job in the upstream pipeline that created the artifacts. + +:::TabTitle Multi-project pipeline Use [`needs:project`](../yaml/index.md#needsproject) to fetch artifacts from an upstream pipeline: @@ -408,7 +453,7 @@ upstream pipeline: deploy: stage: deploy - trigger: my/downstream_project + trigger: my/downstream_project # Path to the project to trigger a pipeline in ``` 1. Use `needs:project` in a job in the downstream pipeline to fetch the artifacts. @@ -431,6 +476,8 @@ upstream pipeline: - `ref` to the branch. - `artifacts` to `true`. +::EndTabs + ### Fetch artifacts from an upstream merge request pipeline When you use `needs:project` to [pass artifacts to a downstream pipeline](#fetch-artifacts-from-an-upstream-pipeline), @@ -623,7 +670,7 @@ Upstream pipelines take precedence over downstream ones. If there are two variables with the same name defined in both upstream and downstream projects, the ones defined in the upstream project take precedence. -### Pass dotenv variables created in a job **(PREMIUM)** +### Pass dotenv variables created in a job **(PREMIUM ALL)** You can pass variables to a downstream job with [`dotenv` variable inheritance](../variables/index.md#pass-an-environment-variable-to-another-job) and [`needs:project`](../yaml/index.md#needsproject). These variables are only available in diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md index 45af40a4cea..7cde8b50524 100644 --- a/doc/ci/pipelines/index.md +++ b/doc/ci/pipelines/index.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# CI/CD pipelines **(FREE)** +# CI/CD pipelines **(FREE ALL)** NOTE: Watch the @@ -84,11 +84,11 @@ project repository. This table lists the refspecs injected for each pipeline type: -| Pipeline type | Refspecs | -|--------------- |---------------------------------------- | -| pipeline for branches | `+<sha>:refs/pipelines/<id>` and `+refs/heads/<name>:refs/remotes/origin/<name>` | -| pipeline for tags | `+<sha>:refs/pipelines/<id>` and `+refs/tags/<name>:refs/tags/<name>` | -| [merge request pipeline](../pipelines/merge_request_pipelines.md) | `+refs/pipelines/<id>:refs/pipelines/<id>` | +| Pipeline type | Refspecs | +|-------------------------------------------------------------------|----------| +| pipeline for branches | `+<sha>:refs/pipelines/<id>` and `+refs/heads/<name>:refs/remotes/origin/<name>` | +| pipeline for tags | `+<sha>:refs/pipelines/<id>` and `+refs/tags/<name>:refs/tags/<name>` | +| [merge request pipeline](../pipelines/merge_request_pipelines.md) | `+refs/pipelines/<id>:refs/pipelines/<id>` | The refs `refs/heads/<name>` and `refs/tags/<name>` exist in your project repository. GitLab generates the special ref `refs/pipelines/<id>` during a @@ -334,7 +334,7 @@ runners do not use regular runners, they must be tagged accordingly. Review the [deployment safety](../environments/deployment_safety.md) page for additional security recommendations for securing your pipelines. -## Trigger a pipeline when an upstream project is rebuilt **(PREMIUM)** +## Trigger a pipeline when an upstream project is rebuilt **(PREMIUM ALL)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9045) in GitLab 12.8. @@ -352,6 +352,7 @@ To trigger the pipeline when the upstream project is rebuilt: 1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. 1. Select **Settings > CI/CD**. 1. Expand **Pipeline subscriptions**. +1. Select **Add project**. 1. Enter the project you want to subscribe to, in the format `<namespace>/<project>`. For example, if the project is `https://gitlab.com/gitlab-org/gitlab`, use `gitlab-org/gitlab`. 1. Select **Subscribe**. diff --git a/doc/ci/pipelines/merge_request_pipelines.md b/doc/ci/pipelines/merge_request_pipelines.md index 045fa8dc16c..356b97aacc0 100644 --- a/doc/ci/pipelines/merge_request_pipelines.md +++ b/doc/ci/pipelines/merge_request_pipelines.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w --- -# Merge request pipelines **(FREE)** +# Merge request pipelines **(FREE ALL)** > [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/351192) from `pipelines for merge requests` to `merge request pipelines` in GitLab 14.8. @@ -67,7 +67,7 @@ To use merge request pipelines: ## Use `rules` to add jobs -You can use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in +Use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in merge request pipelines. For example: ```yaml @@ -95,10 +95,21 @@ job2: - echo "This job also runs in merge request pipelines" ``` +A common `workflow` configuration is to have pipelines run for merge requests, tags, and the default branch. For example: + +```yaml +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH +``` + ## Use `only` to add jobs -You can use the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests` -to configure jobs to run in merge request pipelines. +[`rules`](#use-rules-to-add-jobs) is the preferred method, but you can also use +the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests` +to configure jobs to run in merge request pipelines. For example: ```yaml job1: @@ -125,7 +136,7 @@ Pipelines for forks display with the **fork** badge in the parent project: ![Pipeline ran in fork](img/pipeline_fork_v13_7.png) -### Run pipelines in the parent project **(PREMIUM)** +### Run pipelines in the parent project **(PREMIUM ALL)** Project members in the parent project can trigger a merge request pipeline for a merge request submitted from a fork project. This pipeline: diff --git a/doc/ci/pipelines/merge_trains.md b/doc/ci/pipelines/merge_trains.md index c2fdbe3f6e5..c2bf9743e4f 100644 --- a/doc/ci/pipelines/merge_trains.md +++ b/doc/ci/pipelines/merge_trains.md @@ -4,7 +4,7 @@ group: Pipeline Execution info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- -# Merge trains **(PREMIUM)** +# Merge trains **(PREMIUM ALL)** NOTE: [In GitLab 16.0 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/359057), the **Start merge train** diff --git a/doc/ci/pipelines/merged_results_pipelines.md b/doc/ci/pipelines/merged_results_pipelines.md index 16120924f37..51678e64b10 100644 --- a/doc/ci/pipelines/merged_results_pipelines.md +++ b/doc/ci/pipelines/merged_results_pipelines.md @@ -4,7 +4,7 @@ group: Pipeline Execution info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- -# Merged results pipelines **(PREMIUM)** +# Merged results pipelines **(PREMIUM ALL)** > - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/351192) from `pipelines for merged results` to `merged results pipelines` in GitLab 14.8. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91849) in GitLab 15.1, merged results pipelines also run on [Draft merge requests](../../user/project/merge_requests/drafts.md). diff --git a/doc/ci/pipelines/pipeline_architectures.md b/doc/ci/pipelines/pipeline_architectures.md index ac4c8c1a731..d0324f16ffb 100644 --- a/doc/ci/pipelines/pipeline_architectures.md +++ b/doc/ci/pipelines/pipeline_architectures.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# Pipeline architecture **(FREE)** +# Pipeline architecture **(FREE ALL)** Pipelines are the fundamental building blocks for CI/CD in GitLab. This page documents some of the important concepts related to them. diff --git a/doc/ci/pipelines/pipeline_efficiency.md b/doc/ci/pipelines/pipeline_efficiency.md index c0c8d60b9d6..1d7d6c3289a 100644 --- a/doc/ci/pipelines/pipeline_efficiency.md +++ b/doc/ci/pipelines/pipeline_efficiency.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# Pipeline efficiency **(FREE)** +# Pipeline efficiency **(FREE ALL)** [CI/CD Pipelines](index.md) are the fundamental building blocks for [GitLab CI/CD](../index.md). Making pipelines more efficient helps you save developer time, which: diff --git a/doc/ci/pipelines/schedules.md b/doc/ci/pipelines/schedules.md index 49b129f11aa..75a7d373203 100644 --- a/doc/ci/pipelines/schedules.md +++ b/doc/ci/pipelines/schedules.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference, howto --- -# Scheduled pipelines **(FREE)** +# Scheduled pipelines **(FREE ALL)** Use scheduled pipelines to run GitLab CI/CD [pipelines](index.md) at regular intervals. @@ -67,6 +67,9 @@ the next scheduled time: You can manually run scheduled pipelines once per minute. +When you run a scheduled pipeline manually, the pipeline runs with the +permissions of the user who triggered it, not the permissions of the schedule owner. + ## Take ownership Scheduled pipelines execute with the permissions of the user diff --git a/doc/ci/pipelines/settings.md b/doc/ci/pipelines/settings.md index fe6c88c9c4d..b9c95c63098 100644 --- a/doc/ci/pipelines/settings.md +++ b/doc/ci/pipelines/settings.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference, howto --- -# Customize pipeline configuration **(FREE)** +# Customize pipeline configuration **(FREE ALL)** You can customize how pipelines run for your project. @@ -98,6 +98,7 @@ To avoid this scenario: 1. Select **Settings > CI/CD**. 1. Expand **General pipelines**. 1. Select the **Prevent outdated deployment jobs** checkbox. +1. Optional. Clear the **Allow job retries for rollback deployments** checkbox. 1. Select **Save changes**. For more information, see [Deployment safety](../environments/deployment_safety.md#prevent-outdated-deployment-jobs). |