Skip to content
Snippets Groups Projects
Commit 347745c5 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

download_job_artifacts: add error message if artifact not found

parent 50f7396d
No related branches found
No related tags found
1 merge request!304Add error message if artifact not found
Pipeline #73537 skipped with stage
......@@ -137,29 +137,34 @@ def main(args):
logging.debug(options)
gitlab = gl.Gitlab(options.gitlab_url, private_token=options.token)
if options.path is None:
if options.destination is None:
destination = tempfile.NamedTemporaryFile().name
try:
if options.path is None:
if options.destination is None:
destination = tempfile.NamedTemporaryFile().name
else:
destination = options.destination
print(destination)
filename = download_job_artifacts(
gitlab, destination, options.job, options.project, extract=True
)
print("Downloaded artifacts for job {} to {}".format(options.job, filename))
else:
destination = options.destination
print(destination)
filename = download_job_artifacts(
gitlab, destination, options.job, options.project, extract=True
)
print("Downloaded artifacts for job {} to {}".format(options.job, filename))
else:
if options.destination is None:
destination = tempfile.TemporaryDirectory().name
else:
destination = options.destination
filename = download_job_artifact(
gitlab, destination, options.path, options.job, options.project
)
print(
"Downloaded {} for job {} to {}".format(options.path, options.job, filename)
)
if options.destination is None:
destination = tempfile.TemporaryDirectory().name
else:
destination = options.destination
filename = download_job_artifact(
gitlab, destination, options.path, options.job, options.project
)
print(
"Downloaded {} for job {} to {}".format(
options.path, options.job, filename
)
)
except gl.exceptions.GitlabGetError as e:
exit("ERROR: %s" % e)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment