Skip to main content

Trigger pipeline component

This component triggers a downstream pipeline in a target project and waits until it finishes. The project input is required and accepts either a numeric project ID or a full project path. The token must be allowed to trigger pipelines and read pipeline status in the target project.

The wait timeout is derived from GitLab CI_JOB_TIMEOUT with a 60-second safety buffer.

When the downstream pipeline fails or times out, the job output includes the downstream pipeline URL and a color-coded list of downstream jobs with their current status and URL.

Pipeline access token​

The pipeline access token must have read and write permissions.

By default the component uses the CI_JOB_TOKEN token, but you can specify a custom token by setting the CI_PIPELINE_TRIGGER_TOKEN variable in the pipeline configuration.

Usage​

  • Create GitLab pipeline file .gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/trigger-pipeline@stable
inputs:
project: "xrow-public/test-projects/catalog-pipeline"
inputs:
- version: "$CI_COMMIT_SHA"

Inputs​

NameDescriptionDefaultType
------------
branchThe downstream branch or ref to triggermainstring
inputsPipeline inputs to pass to the downstream pipeline. Each item can be a single-key map, a key/value map, or key=value text.[]array
nameThe name of the jobpipelinestring
needsThe jobs that this job depends on.[]array
projectThe project to trigger. Use either the numeric project ID or the full project path.string
rulesThe jobs that this job depends on.[{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_COMMIT_TAG","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}]array
stageThe name of the stageteststring
timeoutThe maximum time to wait for the downstream pipeline to complete, in seconds. Defaults to the job's remaining timeout minus a safety buffer.1hstring
tokenThe trigger token to use for triggering the downstream pipeline. Defaults to the CI_JOB_TOKEN.CI_JOB_TOKENstring