Skip to content
Snippets Groups Projects
Commit e735be3c authored by s2870355's avatar s2870355
Browse files

handle empty artifacts list

parent a8aab6db
No related branches found
No related tags found
No related merge requests found
Pipeline #83821 canceled
......@@ -65,7 +65,7 @@ class job_data:
image = None
depends = []
stage = "unknown"
artifacts = []
artifacts = None
cache = []
for line in file_string.splitlines():
line = line.removesuffix("\n")
......@@ -117,10 +117,10 @@ class job_data:
name : str = self.location.replace(os.path.sep, '/')
stage : str = self.stage
needs = [ r.replace(os.path.sep, '/') for r in self.depends]
if len(self.artifact) != 0:
artifacts = self.artifact
if self.artifact is None:
artifact = "untracked"
else:
artifacts = "untracked"
artifacts = self.artifact
if len(self.cache) != 0:
cache = self.cache
else:
......@@ -138,9 +138,10 @@ class job_data:
if artifacts == "untracked":
output = output + '\t' + 'artifacts:\n\t\tuntracked: true\n'
else:
output = output + '\t' + 'artifacts:\n\t\tpaths:\n'
for artifact in artifacts:
output = output + "\t\t\t- \"" + artifact + '\"\n'
if len(artifacts) != 0:
output = output + '\t' + 'artifacts:\n\t\tpaths:\n'
for artifact in artifacts:
output = output + "\t\t\t- \"" + artifact + '\"\n'
if cache is not None:
if cache == "untracked":
output = output + '\t' + 'cache:\n\t\tuntracked: true\n'
......
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