Skip to main content

This component triggers a downstream pipeline in a target project and waits until it finishes. The project-id input is required, and 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.

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/test-pipeline@stable
inputs:
project-id: "12345678"

Inputs

NameDescriptionDefaultType
------------
branchThe branch to testmainstring
nameThe name of the jobpipelinestring
needsThe jobs that this job depends on.[]array
project-idThe project to teststring
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
versionThe version of the component to test. Usually a branch name or tag. Defaults to the commit hash.$CI_COMMIT_SHAstring