Skip to content
Snippets Groups Projects
Commit f6d3bcc3 authored by Ralf Jung's avatar Ralf Jung
Browse files

add support for filtering to build-all

parent 9800cd4f
No related branches found
No related tags found
No related merge requests found
...@@ -32,14 +32,17 @@ PROJECTS = [ ...@@ -32,14 +32,17 @@ PROJECTS = [
{ 'name': 'tutorial-popl21', 'branch': 'master', 'vars': ['STDPP_REV', 'IRIS_REV'] }, { 'name': 'tutorial-popl21', 'branch': 'master', 'vars': ['STDPP_REV', 'IRIS_REV'] },
] ]
filter = sys.argv[1] if len(sys.argv) > 1 else ''
for project in PROJECTS: for project in PROJECTS:
print("Triggering build for {}{}...".format(project['name'], '' if project['branch'] == 'master' else ':'+project['branch'])) name_branch = project['name'] + ('' if project['branch'] == 'master' else ':'+project['branch'])
id = str(project['id']) if 'id' in project else "iris%2F{}".format(project['name']) if filter in name_branch:
url = "https://gitlab.mpi-sws.org/api/v4/projects/{}/pipeline".format(id) print("Triggering build for {}...".format(name_branch))
json = { id = str(project['id']) if 'id' in project else "iris%2F{}".format(project['name'])
'ref': project['branch'], url = "https://gitlab.mpi-sws.org/api/v4/projects/{}/pipeline".format(id)
'variables': list(map(lambda var: { 'key': var, 'value': os.environ.get(var, "master") }, project['vars'])), json = {
} 'ref': project['branch'],
r = requests.post(url, headers={'PRIVATE-TOKEN': GITLAB_TOKEN}, json=json) 'variables': list(map(lambda var: { 'key': var, 'value': os.environ.get(var, "master") }, project['vars'])),
r.raise_for_status() }
print(" Pipeline running at {}".format(r.json()['web_url'])) r = requests.post(url, headers={'PRIVATE-TOKEN': GITLAB_TOKEN}, json=json)
r.raise_for_status()
print(" Pipeline running at {}".format(r.json()['web_url']))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment