4

I want to download an Artifact in a job present in a Child pipeline from another job present in another Child pipeline part of the same parent-child pipeline hierarchy.

I tried with the files below that are inspired from the Gitlab documentation (see the paragraph "Example of needs:pipeline:job" in https://docs.gitlab.com/ee/ci/yaml/) but with no success (I have this error : This job depends on other jobs with expired/erased artifacts)

parent.yml

parent1:
  stage: test
  trigger:
    include: child1.yml
    strategy: depend

parent2: stage: test trigger: include: child2.yml strategy: depend variables: PARENT_PIPELINE_ID: $CI_PIPELINE_ID

Child1.yml

create-artifact:
  stage: build
  script: echo "sample artifact" > artifact.txt
  artifacts:
    paths: [artifact.txt]

Child2.yml

use-artifact:
  script: cat artifact.txt
  needs:
    - pipeline: $PARENT_PIPELINE_ID
      job: create-artifact

So according to the official Gitlab documentation : A child pipeline can download artifacts from a job in its parent pipeline or another child pipeline in the same parent-child pipeline hierarchy. so I am wondering how to make it work in my example files?

Pawel W
  • 9
  • 2
AmineDg
  • 41
  • 1
  • 2
  • Hi, it is not possible yet. See the issue https://gitlab.com/gitlab-org/gitlab/-/issues/285100 – borievka Jun 02 '22 at 15:41
  • Hello. You are trying to use it on the different parent-child pipeline hierarchy. Look into the documentation that you are mention - "in the same parent-child pipeline hierarchy" – Serhiy Nazarov Oct 02 '22 at 19:32
  • I hear its possible by using commit-ref in your cache, then grabbing it from the cache – blamb Nov 17 '22 at 00:37
  • @blamb do you have and example of that that you could post as an anwser? – St. Jan Jul 18 '23 at 13:14
  • 1
    sorry I dont, id have to look it up again. I will check my browser history for it though. I think i found it on a gitlab bug report page. – blamb Jul 18 '23 at 15:37
  • would be great, I have been reading and reading...still no solution – St. Jan Jul 18 '23 at 21:27

0 Answers0