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

Confluence: add error handling if artifact not found

parent 1a519057
No related branches found
No related tags found
1 merge request!344Build documentation in dedicated job
......@@ -5,6 +5,7 @@ import fnmatch
import sys
import tempfile
from gitlab import GitlabGetError
from gitlab.client import Gitlab
from gitlab.v4.objects import Project, ProjectPipelineJob
......@@ -35,13 +36,18 @@ def get_job_env_variables(
with tempfile.NamedTemporaryFile() as target_file:
print(f"Downloading file {env_file} from job {job.name}", file=sys.stderr)
download_job_artifact(
gitlab,
target_file.name,
env_file,
job.id,
project=project,
)
try:
download_job_artifact(
gitlab,
target_file.name,
env_file,
job.id,
project=project,
)
except GitlabGetError:
print(
f"Artifact '{env_file}' not found in {job.web_url}", file=sys.stderr
)
lines = [line.decode("utf-8").rstrip() for line in target_file.readlines()]
......
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