pipe = cur_project.pipelines.get(pipeline_id)
REV = pipe.sha
else:
- cur_project = get_gitlab_project(gl, args.project)
if not REV:
REV = check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
- pipe = wait_for_pipeline(cur_project, REV)
+ cur_project = gl.projects.get("mesa/mesa")
+ pipe = wait_for_pipeline(cur_project, REV, timeout=10)
+ if not pipe:
+ cur_project = get_gitlab_project(gl, args.project)
+ pipe = wait_for_pipeline(cur_project, REV)
print(f"Revision: {REV}")
print(f"Pipeline: {pipe.web_url}")
)
-def wait_for_pipeline(project, sha: str):
+def wait_for_pipeline(project, sha: str, timeout=None):
"""await until pipeline appears in Gitlab"""
print(f"⏲ for the pipeline to appear in {project.path_with_namespace}..", end="")
+ start_time = time.time()
while True:
pipelines = project.pipelines.list(sha=sha)
if pipelines:
print("", flush=True)
return pipelines[0]
print("", end=".", flush=True)
+ if timeout and time.time() - start_time > timeout:
+ print(" not found", flush=True)
+ return None
time.sleep(1)