Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Roux
Iris
Commits
b08379d9
"theories/git-rts@gitlab.mpi-sws.org:msammler/iris-coq.git" did not exist on "a007ecf5cf5da254612b156f9ac982ac89879020"
Commit
b08379d9
authored
3 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
remove duplication in build-all script
parent
2da41848
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build-all
+17
-11
17 additions, 11 deletions
build-all
with
17 additions
and
11 deletions
build-all
+
17
−
11
View file @
b08379d9
...
...
@@ -9,17 +9,23 @@ import requests
# (default to default git branch). IRIS_REPO and STDPP_REPO can be used to take branches from forks.
# Setting IRIS to "user:branch" will use the given branch on that user's fork of Iris, and similar for STDPP.
# Pre-processing: we support setting `PROJECT` to `user:branch` (GitLab MR syntax),
# which will set `PROJECT_REPO` and `PROJECT_REV` automatically.
def
preprocess_repo_rev
(
var
,
project
):
# Pre-processing for variables: you can set 'PROJECT' to 'user:branch',
# or set 'PROJECT_REPO' and 'PROJECT_REV' automatically.
PROJECT_VARS
=
[
'
STDPP
'
,
'
IRIS
'
,
'
ORC11
'
,
'
GPFSL
'
]
GITLAB_VARS
=
[]
for
var
in
PROJECT_VARS
:
if
var
in
os
.
environ
:
(
repo
,
rev
)
=
os
.
environ
[
var
].
split
(
'
:
'
)
os
.
environ
[
var
+
"
_REPO
"
]
=
repo
+
"
/
"
+
project
os
.
environ
[
var
+
"
_REV
"
]
=
rev
preprocess_repo_rev
(
'
STDPP
'
,
'
stdpp
'
)
preprocess_repo_rev
(
'
IRIS
'
,
'
iris
'
)
preprocess_repo_rev
(
'
ORC11
'
,
'
orc11
'
)
preprocess_repo_rev
(
'
GPFSL
'
,
'
gpfsl
'
)
repo
=
repo
+
"
/
"
+
var
.
lower
()
else
:
repo
=
os
.
environ
.
get
(
var
+
"
_REPO
"
)
rev
=
os
.
environ
.
get
(
var
+
"
_REV
"
)
# Add them to GITLAB_VARS
if
repo
is
not
None
:
GITLAB_VARS
.
append
({
'
key
'
:
var
+
"
_REPO
"
,
'
value
'
:
repo
})
if
rev
is
not
None
:
GITLAB_VARS
.
append
({
'
key
'
:
var
+
"
_REV
"
,
'
value
'
:
rev
})
# Check if everything is set
if
not
"
GITLAB_TOKEN
"
in
os
.
environ
:
...
...
@@ -27,7 +33,7 @@ if not "GITLAB_TOKEN" in os.environ:
print
(
"
You can create such tokens at <https://gitlab.mpi-sws.org/profile/personal_access_tokens>.
"
)
print
(
"
Make sure you grant access to the
'
api
'
scope.
"
)
sys
.
exit
(
1
)
if
not
"
IRIS_REV
"
in
os
.
environ
:
if
not
"
IRIS_REV
"
in
os
.
environ
and
not
"
IRIS
"
in
os
.
environ
:
print
(
"
Please set IRIS_REV, STDPP_REV, ORC11_REV and GPFSL_REV environment variables to the branch/tag/commit of the respective project that you want to use.
"
)
print
(
"
Only IRIS_REV is mandatory, the rest defaults to the default git branch.
"
)
sys
.
exit
(
1
)
...
...
@@ -56,7 +62,7 @@ for project in PROJECTS:
url
=
"
https://gitlab.mpi-sws.org/api/v4/projects/{}/pipeline
"
.
format
(
id
)
json
=
{
'
ref
'
:
project
[
'
branch
'
],
'
variables
'
:
[{
'
key
'
:
var
,
'
value
'
:
os
.
environ
[
var
]
}
for
var
in
VARS
if
var
in
os
.
environ
]
,
'
variables
'
:
GITLAB_VARS
,
}
r
=
requests
.
post
(
url
,
headers
=
{
'
PRIVATE-TOKEN
'
:
GITLAB_TOKEN
},
json
=
json
)
r
.
raise_for_status
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment