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
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| branch | The branch to test | main | string |
| name | The name of the job | pipeline | string |
| needs | The jobs that this job depends on. | [] | array |
| project-id | The project to test | string | |
| rules | The 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 |
| stage | The name of the stage | test | string |
| timeout | The maximum time to wait for the downstream pipeline to complete, in seconds. Defaults to the job's remaining timeout minus a safety buffer. | 1h | string |
| token | The trigger token to use for triggering the downstream pipeline. Defaults to the CI_JOB_TOKEN. | $CI_JOB_TOKEN | string |
| version | The version of the component to test. Usually a branch name or tag. Defaults to the commit hash. | $CI_COMMIT_SHA | string |