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

Download a single artifact file by job ID #586

Closed
Nowaker opened this issue Oct 17, 2020 · 1 comment · Fixed by #587
Closed

Download a single artifact file by job ID #586

Nowaker opened this issue Oct 17, 2020 · 1 comment · Fixed by #587
Assignees
Labels
enhancement New feature or request hacktoberfest Hacktoberfest event help wanted Good for newcomers

Comments

@Nowaker
Copy link

Nowaker commented Oct 17, 2020

Feature request: https://docs.gitlab.com/ee/api/job_artifacts.html#download-a-single-artifact-file-by-job-id

Currently, the library allows to download all artifacts in gzip format only.

@Nowaker
Copy link
Author

Nowaker commented Oct 17, 2020

Here's how I achieved it myself:

  project_id = Gitlab.client.url_encode(project)
  json = Gitlab.client.get(
    "/projects/#{project_id}/jobs/#{artifact_job.id}/artifacts/operation.json",
  ).to_h.to_json

A minor inconvenience was the fact .get returned the objectified hash thing, whereas I'd prefer a blob. I didn't know how to achieve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest event help wanted Good for newcomers
Projects
None yet
3 participants