How to download metadata.gz


#1

I’m trying to script away downloading the three special files from our GitLab projects. Currently, I’m able to download artifacts.zip, and individual files from the zip, but not the other two special files: metadata.gz and job.log.

Here’s some stuff I’ve done:

# Grab the list of job data
r = requests.get("https://gitlab.local.com/api/v4/projects/12/jobs/13", headers={'PRIVATE-TOKEN':'...'}, verify='...')

# Display artifacts available (shows artifacts.zip, metadata.gz, and job.log)
r.json()['artifacts']

# Printing the filename of the artifacts (best in a for loop)
r.json()['artifacts'][0]['filename']
r.json()['artifacts'][1]['filename']
...

# Download artifacts.zip
r = requests.get(".../jobs/13/artifacts", ...)
with open(".../artifacts.zip", 'wb') as f:
  f.write(artifacts.content)

# Download metadata.gz
?