Retrieve stored artifacts on subsequent jobs

Trying to get the stored artifact when a job runs & use the info stored in the artifact on subsequent jobs. The URL that the API mentions always returns a 404.

The gitlab API, describes a URL to fetch the artifact with a help of a URL which in our case gets generated like so: https://gitlab.com/api/v4/projects/22977885/jobs/artifacts/SPD-965-appetize-ios/raw/appetize-ios-information.json?job=review:appetize:ios but gives out a 404 where as the information regarding CI_JOB_NAME & CI_COMMIT_REF_NAME are picked up correctly.

The artifact in theory gets stored here after the job runs: https://agrando.gitlab.io/-/agr-farmer-app/-/jobs/1050124747/artifacts/appetize-ios-information.json

Troubleshooting steps:

  • Tried to generate a PRIVATE_TOKEN and used it as per the API docs, returns 404.

I have a feeling you want to use artifacts from previous pipelines so there are couple options.

Option 1: Use cache
Option 2: Use artifact storage outside GitLab. Like Artifactory or Nexus.
Option 3: Use the API where the URL is https://gitlab.com/api/v4/projects/:id/jobs/artifacts/:ref_name/download?job=name. You can find more examples in the official documentation.