Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: add a one-liner for downloading all artefacts from a workflow #8537

Open
Pyrrha opened this issue Dec 19, 2023 · 3 comments
Open

Comments

@Pyrrha
Copy link
Contributor

Pyrrha commented Dec 19, 2023

Hello,

After my contribution in #8502, I encountered the use case of downloading artefacts from multiple jobs (e.g. a pipeline release which produces several artefacts, that we want to retrieve). My workaround was:

curl --silent --request GET --url https://circleci.com/api/v2/workflow/:workflow_id/job --header "Circle-Token: $CIRCLE_TOKEN" \
  | jq '.items[].job_number' \
  | xargs -I {} curl --silent --request GET --url 'https://circleci.com/api/v2/project/:vcs/:org/:project/{}/artifacts' --header "Circle-Token: $CIRCLE_TOKEN" \
  | grep -o -E 'https://([^"]*)' \
  | wget --verbose --header "Circle-Token: $CIRCLE_TOKEN" --no-verbose --input-file -

Is it a common use case I can document into a new PR?
Also, it's using API v2. I also can submit a fix for #8502 using v2 too.

Thanks.

@rosieyohannan
Copy link
Contributor

Thanks so much for this @Pyrrha! Let me check and get back to you :-D

@Pyrrha
Copy link
Contributor Author

Pyrrha commented Jan 3, 2024

Hello,

@rosieyohannan any news about the coherence of this script with CircleCI usage?

Thanks.

@rosieyohannan
Copy link
Contributor

Hello! @Pyrrha! We would like to add this solution to the docs. You are welcome to submit a PR and we can take it from there, or alternatively we can add this work to our backlog internally. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants