0

I have a main project that has dependencies from other projects, say project A and project B that live in other repos. I want to trigger those dependencies to build from the main .gitlab-ci.yml and then get those build artifacts back in the main pipeline.

This is what I've tried in the .gitlab-ci.yml file:

stages:
    - bridge
    - build

bridge-to-projectA:
    stage: bridge
    trigger:
        project: project/A
        branch: main
        strategy: depend

get-artifacts:
    stage: build
    needs:
        - project: project/A
        job: build-A
        artifacts: true
    tags:
        - myrunnertag

Then in project A I have:

stages:
    - build

build-A:
    stage: build
    script:
        - echo "This is my artifact" >> tmp.txt
    artifacts:
        paths:
            - tmp.txt

I'm trying to use the needs:project syntax for gitlab multi-project pipelines but the get-artifacts job keeps failing with the error:

The job could not start because it could not retrieve the needed artifacts.

I think it is because you can only use needs:project for downstream pipelines and maybe the main project is upstream so it doesn't work? How do I setup a pipeline with dependencies when I have multiple repos?

grace9
  • 47
  • 6

0 Answers0