Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
fsl-ci-rules
Commits
b9154bff
Commit
b9154bff
authored
Nov 13, 2020
by
Paul McCarthy
🚵
Browse files
RF: Trigger downstream passes/fails based on downstream builds
parent
52c5978c
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/trigger_check_downstream_packages.py
View file @
b9154bff
...
...
@@ -8,6 +8,7 @@
#
import
os
import
sys
from
fsl_ci_utils.conda
import
(
load_meta_yaml
,
read_channel_repodata
,
...
...
@@ -60,8 +61,14 @@ def trigger_pipeline_on_packages(upstream, packages, server, token, staging):
pipelines
.
append
((
recipe_path
,
trigger_pipeline
(
recipe_path
,
'master'
,
server
,
token
,
variables
)))
passed
=
True
for
recipe_path
,
pipeline
in
pipelines
:
wait_on_pipeline
(
recipe_path
,
pipeline
[
'id'
],
server
,
token
)
status
=
wait_on_pipeline
(
recipe_path
,
pipeline
[
'id'
],
server
,
token
)
passed
=
passed
and
(
status
==
'success'
)
return
passed
def
main
():
...
...
@@ -93,8 +100,10 @@ def main():
if
len
(
downstream
)
==
0
:
print
(
f
'
{
pkgname
}
nas no downstream dependants - nothing to do!'
)
else
:
trigger_pipeline_on_packages
(
result
=
trigger_pipeline_on_packages
(
upstream
,
downstream
,
gitlab_url
,
token
,
staging
)
sys
.
exit
(
0
if
result
else
1
)
if
__name__
==
'__main__'
:
...
...
utils/fsl_ci_utils/conda_api.py
View file @
b9154bff
...
...
@@ -34,7 +34,7 @@ def http_request(url, token=None, data=None, method=None):
headers
[
'Content-Type'
]
=
'application/json'
data
=
json
.
dumps
(
data
).
encode
(
'utf-8'
)
print
(
f
'
{
data
}
'
)
print
(
f
'
payload:
{
data
}
'
)
request
=
urlrequest
.
Request
(
url
,
headers
=
headers
,
data
=
data
,
method
=
method
)
...
...
@@ -347,6 +347,7 @@ def wait_on_pipeline(project_path, pipeline_id, server, token):
if
status
not
in
(
'created'
,
'waiting_for_resource'
,
'preparing'
,
'pending'
,
'running'
):
print
(
f
'Pipeline has stopped - final status:
{
status
}
'
)
break
print
(
f
'Pipeline status:
{
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