Commit d5b15f3d authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

get builds gitlab

parent 9b20840a
Pipeline #14808 failed with stage
in 3 minutes and 7 seconds
...@@ -345,7 +345,9 @@ class Project(Links, NamedModel, TimeStampedModel): ...@@ -345,7 +345,9 @@ class Project(Links, NamedModel, TimeStampedModel):
return self.repo_set.get(forge__source=SOURCES.gitlab, namespace=self.main_namespace) return self.repo_set.get(forge__source=SOURCES.gitlab, namespace=self.main_namespace)
def ci_jobs(self): def ci_jobs(self):
self.main_gitlab_repo().get_jobs_gitlab() r = self.main_gitlab_repo()
r.get_jobs_gitlab()
r.get_builds_gitlab()
def update(self, only_main_branches=True): def update(self, only_main_branches=True):
if self.main_namespace is None: if self.main_namespace is None:
...@@ -591,7 +593,7 @@ class Repo(TimeStampedModel): ...@@ -591,7 +593,7 @@ class Repo(TimeStampedModel):
return getattr(self, f'get_builds_{self.forge.get_source_display()}')() return getattr(self, f'get_builds_{self.forge.get_source_display()}')()
def get_builds_gitlab(self): def get_builds_gitlab(self):
for pipeline in self.api_list('/pipelines'): for pipeline in self.api_list('/pipelines', limit=2):
pid, ref = pipeline['id'], pipeline['ref'] pid, ref = pipeline['id'], pipeline['ref']
if self.project.tag_set.filter(name=ref).exists(): if self.project.tag_set.filter(name=ref).exists():
continue continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment