Problem Statement:
I have a requirement to call child pipeline from different upstream projects by also passing artifacts from upstream pipelines. Example:
project A → .gitlab-ci.yml
stages:
build
test
build
stage: build
script:
- touch artifactA.txt
artifacts:
paths:
- artifactA.txt
test
stage: test
# do something here to call project C pipeline residing in different project which tests artifacts from build job
project B → .gitlab-ci.yml
stages:
build
test
build
stage: build
script:
- touch artifactB.txt
artifacts:
paths:
- artifactB.txt
test
stage: test
# do something here to call child pipeline residing in different project which tests artifacts from build job
project C → .gitlab-ci.yml
stages:
test
test
stage: test
# do something here which accepts artifacts from upstream pipeline when triggered and runs tests against it.
needs:
- project: specify list of upstream projects here which can trigger this pipeline
ref: integration-test-pipeline
job: build
artifacts: true
Tried few different ways by referring to gitlab docs by using needs
, trigger
, dependencies
keywords and their variations but nothing worked so far. As a last resort I can try the API way but would rather prefer if something is already built into gitlab for such a use case.