Skip to content

Instantly share code, notes, and snippets.

@KrishnB
Created March 3, 2021 10:55
Show Gist options
  • Save KrishnB/89e4536380a58034d19728e091a39712 to your computer and use it in GitHub Desktop.
Save KrishnB/89e4536380a58034d19728e091a39712 to your computer and use it in GitHub Desktop.
.download_history: &download_history
after_script:
- mkdir backup && cd backup || true
- "curl --location --output report.zip --request GET \"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/master/download?job=pages\" --header \"Authorization: Bearer ${CI_DEPLOY_TOKEN}\" || true"
- (unzip report.zip) || true
- cd ../
- (cp -r backup/public/history/ allure-results/history) || true
@sahmod
Copy link

sahmod commented Sep 29, 2023

curl doesn't download gitlab artifacts from previous pipeline using .download_history. I am getting 404 when I cat pages.zip do I need to change anything?
e2e-test:
<<: *run-test
<<: *download-history //I am using your template to download pages.zip
// reports being generated in cucumber onComplete hook and deploys in pages
pages:
stage: deploy
when: always
dependencies:
- e2e-test
script:
- ls -ltrah ./reports
artifacts:
name: "$CI_JOB_NAME"
paths:
- public
expire_in: 30 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment