Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
8
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
finestructure
pipeline-trigger
Commits
06e09f13
Commit
06e09f13
authored
May 08, 2021
by
Sven A. Schmidt
Browse files
Merge branch 'fix-manual-run' into 'master'
Closes
#35
Closes
#35
See merge request
!65
parents
b95c87b7
85b59e21
Changes
1
Hide whitespace changes
Inline
Side-by-side
trigger.py
View file @
06e09f13
...
...
@@ -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
'
\n
Retrying after
{
retry_after
}
s'
)
sleep
(
retry_after
)
retries_left
-=
1
return
pipeline
,
status
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment