Skip to main content
Bumped by Community user
Bumped by Community user
remove noise
Source Link
Pierre.Vriens
  • 7.2k
  • 14
  • 37
  • 84

This my first post in the DevOps StackExchange.

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?

Thanks for your help and please let me know if you need extra information.

This my first post in the DevOps StackExchange.

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?

Thanks for your help and please let me know if you need extra information.

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?

Source Link
AmineDg
  • 51
  • 1
  • 2

Gitlab : Download artifacts from a job in another child pipeline

This my first post in the DevOps StackExchange.

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?

Thanks for your help and please let me know if you need extra information.