Commit 06e09f13 authored by Sven A. Schmidt's avatar Sven A. Schmidt
Browse files

Merge branch 'fix-manual-run' into 'master'

Closes #35

Closes #35

See merge request !65
parents b95c87b7 85b59e21
......@@ -16,6 +16,7 @@ STATUS_MANUAL = 'manual'
STATUS_CANCELED = 'canceled'
STATUS_SUCCESS = 'success'
STATUS_SKIPPED = 'skipped'
STATUS_CREATED = 'created'
ACTION_FAIL = 'fail'
ACTION_PASS = 'pass'
......@@ -250,6 +251,8 @@ def check_pipeline_status(args, pid, proj, project_url):
try:
pipeline = proj.pipelines.get(pid)
status = pipeline.status
if status == STATUS_CREATED:
raise Exception(f"created status is not a valid one in this context, waiting for a different one...")
if status in [STATUS_MANUAL, STATUS_SKIPPED] and args.on_manual == ACTION_PLAY:
status = handle_manual_pipeline(args, pipeline, proj, status)
......@@ -264,7 +267,12 @@ def check_pipeline_status(args, pid, proj, project_url):
print('check your api token, or check if there are connection issues.')
print()
raise PipelineFailure(return_code=2, pipeline_id=pid)
retry_after = 2 ** (max_retries - retries_left)
print(f'\nRetrying after {retry_after} s')
sleep(retry_after)
retries_left -= 1
return pipeline, status
......
Supports Markdown
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