Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lennard Gäher
Iris
Commits
f6d3bcc3
Commit
f6d3bcc3
authored
Mar 23, 2021
by
Ralf Jung
Browse files
add support for filtering to build-all
parent
9800cd4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
build-all
View file @
f6d3bcc3
...
...
@@ -32,14 +32,17 @@ PROJECTS = [
{
'name'
:
'tutorial-popl21'
,
'branch'
:
'master'
,
'vars'
:
[
'STDPP_REV'
,
'IRIS_REV'
]
},
]
filter
=
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>
1
else
''
for
project
in
PROJECTS
:
print
(
"Triggering build for {}{}..."
.
format
(
project
[
'name'
],
''
if
project
[
'branch'
]
==
'master'
else
':'
+
project
[
'branch'
]))
id
=
str
(
project
[
'id'
])
if
'id'
in
project
else
"iris%2F{}"
.
format
(
project
[
'name'
])
url
=
"https://gitlab.mpi-sws.org/api/v4/projects/{}/pipeline"
.
format
(
id
)
json
=
{
'ref'
:
project
[
'branch'
],
'variables'
:
list
(
map
(
lambda
var
:
{
'key'
:
var
,
'value'
:
os
.
environ
.
get
(
var
,
"master"
)
},
project
[
'vars'
])),
}
r
=
requests
.
post
(
url
,
headers
=
{
'PRIVATE-TOKEN'
:
GITLAB_TOKEN
},
json
=
json
)
r
.
raise_for_status
()
print
(
" Pipeline running at {}"
.
format
(
r
.
json
()[
'web_url'
]))
name_branch
=
project
[
'name'
]
+
(
''
if
project
[
'branch'
]
==
'master'
else
':'
+
project
[
'branch'
])
if
filter
in
name_branch
:
print
(
"Triggering build for {}..."
.
format
(
name_branch
))
id
=
str
(
project
[
'id'
])
if
'id'
in
project
else
"iris%2F{}"
.
format
(
project
[
'name'
])
url
=
"https://gitlab.mpi-sws.org/api/v4/projects/{}/pipeline"
.
format
(
id
)
json
=
{
'ref'
:
project
[
'branch'
],
'variables'
:
list
(
map
(
lambda
var
:
{
'key'
:
var
,
'value'
:
os
.
environ
.
get
(
var
,
"master"
)
},
project
[
'vars'
])),
}
r
=
requests
.
post
(
url
,
headers
=
{
'PRIVATE-TOKEN'
:
GITLAB_TOKEN
},
json
=
json
)
r
.
raise_for_status
()
print
(
" Pipeline running at {}"
.
format
(
r
.
json
()[
'web_url'
]))
Write
Preview
Markdown
is supported
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