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

rewrite build-all in python

parent a82dbaf9
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/usr/bin/python3
set -eo pipefail import sys, os
import requests
# A script to build Iris' reverse-dependencies (the one that usually get built every night against Iris master) # A script to build Iris' reverse-dependencies (the one that usually get built every night against Iris master)
# against a branch of your choice. # against a branch of your choice.
...@@ -7,28 +8,26 @@ set -eo pipefail ...@@ -7,28 +8,26 @@ set -eo pipefail
# Set at least one of IRIS_REV or STDPP_REV to control which branches of these projects to build against # Set at least one of IRIS_REV or STDPP_REV to control which branches of these projects to build against
# (default to `master`). # (default to `master`).
if [[ -z "$GITLAB_TOKEN" ]]; then if not "GITLAB_TOKEN" in os.environ:
echo "You need to set the GITLAB_TOKEN environment variable to a GitLab access token." print("You need to set the GITLAB_TOKEN environment variable to a GitLab access token.")
echo "You can create such tokens at <https://gitlab.mpi-sws.org/profile/personal_access_tokens>." print("You can create such tokens at <https://gitlab.mpi-sws.org/profile/personal_access_tokens>.")
echo "Make sure you grant access to the 'api' scope." print("Make sure you grant access to the 'api' scope.")
exit 1 sys.exit(1)
fi
IRIS_REV=${IRIS_REV:-master} GITLAB_TOKEN = os.environ["GITLAB_TOKEN"]
STDPP_REV=${STDPP_REV:-master} PROJECTS = [
{ 'name': 'lambda-rust', 'branch': 'master', 'vars': ['STDPP_REV', 'IRIS_REV'] },
{ 'name': 'lambda-rust', 'branch': 'ci/weak_mem', 'vars': ['STDPP_REV', 'IRIS_REV', 'ORC11_REV', 'GPFSL_REV'] },
{ 'name': 'iron', 'branch': 'master', 'vars': ['STDPP_REV', 'IRIS_REV'] },
]
curl --fail -sS -X POST https://gitlab.mpi-sws.org/api/v4/projects/iris%2Flambda-rust/pipeline \ for project in PROJECTS:
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ print("Triggering build for {}{}...".format(project['name'], '' if project['branch'] == 'master' else ':'+project['branch']))
--header "Content-Type: application/json" \ url = "https://gitlab.mpi-sws.org/api/v4/projects/iris%2F{}/pipeline".format(project['name'])
--data '{ "ref": "master", "variables": [ {"key": "STDPP_REV", "value": "'"$STDPP_REV"'"}, {"key": "IRIS_REV", "value": "'"$IRIS_REV"'"} ] }' json = {
echo 'ref': project['branch'],
curl --fail -sS -X POST https://gitlab.mpi-sws.org/api/v4/projects/iris%2Flambda-rust/pipeline \ 'variables': list(map(lambda var: { 'key': var, 'value': os.environ.get(var, "master") }, project['vars'])),
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ }
--header "Content-Type: application/json" \ r = requests.post(url, headers={'PRIVATE-TOKEN': GITLAB_TOKEN}, json=json)
--data '{ "ref": "ci/weak_mem", "variables": [ {"key": "STDPP_REV", "value": "'"$STDPP_REV"'"}, {"key": "IRIS_REV", "value": "'"$IRIS_REV"'"}, {"key": "ORC11_REV", "value": "master"}, {"key": "GPFSL_REV", "value": "master"} ] }' r.raise_for_status()
echo print(" Pipeline running at {}".format(r.json()['web_url']))
curl --fail -sS -X POST https://gitlab.mpi-sws.org/api/v4/projects/iris%2Firon/pipeline \
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--header "Content-Type: application/json" \
--data '{ "ref": "master", "variables": [ {"key": "STDPP_REV", "value": "'"$STDPP_REV"'"}, {"key": "IRIS_REV", "value": "'"$IRIS_REV"'"} ] }'
echo
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