Closed
Description
GitLab 10.0 added an API route to download a single artifact file:
GET /projects/:id/jobs/:job_id/artifacts/*artifact_path
Example request:
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \
"https://gitlab.example.com/api/v4/projects/1/jobs/5/artifacts/some/release/file.pdf"
python-gitlab
does not appear to support this.
I imagine something like this:
job.get_artifact('some/release/file.pdf', streamed=True, action=whatever)
Activity
JonathonReinhart commentedon Feb 9, 2018
Working on a patch here: JonathonReinhart/python-gitlab@master...432-download-single-artifact
gpocentek commentedon Mar 2, 2018
Hi @JonathonReinhart
I've had a look at your patch. It looks OK but I'd prefer to have a new
actifact
method instead of modifying the existingartifacts
. Let me know if you want to keep working on this, I'll be happy to review and merge!Thanks!
JonathonReinhart commentedon Mar 17, 2018
@gpocentek Sorry, I got busy and didn't get a chance to come back to this. I agree with your new, separate method. Thanks for the addition!
Vickey-Wu commentedon Apr 12, 2019
i find we can use python-gitlab's build_or_job.trace() to get artifacts content we need, if you had printed them in your .gitlab-ci.yml