Looking for good examples of cross project artifact sharing

I’m trying to do the following:
-commit updates to a source file into repo A
-in repo A, run a pipeline that first copies the source file into artifacts, then triggers the pipeline in repoB
-when the pipeline is triggered in repo B, run a script to generate processed output using the source file from artifacts in repo A. Save this output to repo B

  • What are you seeing, and how does that differ from what you expect to see?
    The dependent job in repo B always fails with “This job depends on other jobs with expired/erased artifacts”

  • What version are you on? Are you using self-managed or GitLab.com?

    • GitLab (Hint: /help): self managed gitlab premium
    • *Runner (Hint: /admin/runners): shell runner
  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

Repo A:

first-create-artifacts-job:
    script:
    - echo "hello to all of the world except those who don't like pizza"
    artifacts:
        paths:
        - flexa/docs #this contains index.html

trigger-second-project-job:
    trigger:
        project: paul/repoB
        strategy: depend

Repo B:

hopefully-downstream-job:
    stage: build
    script:
    #I would like to run a docgen script here using this index.html file
    - cat flexa/docs/index.html
    needs:
      - project: paul/repoA
        ref: master
        job: first-create-artifacts-job
        artifacts: true
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

I always get the error “This job depends on other jobs with expired/erased artifacts.”

Thanks for taking the time to be thorough in your request, it really helps! :blush: