trigger_cerbero_pipeline.py: Do not hardcode gitlab instance
When GStreamer is forked into a private GitLab instance we should trigger cerbero into that private instance too. Otherwise the token won't be accepted. Also do not hardcode the cerbero project ID because it is instance specific. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1056>
This commit is contained in:
parent
01cfc1ee7e
commit
d4296b7d3d
@ -5,7 +5,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import gitlab
|
import gitlab
|
||||||
|
|
||||||
CERBERO_ID = 1340
|
CERBERO_PROJECT = 'gstreamer/cerbero'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Status:
|
class Status:
|
||||||
@ -33,13 +34,12 @@ def fprint(msg):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
gl = gitlab.Gitlab(
|
server = os.environ['CI_SERVER_URL']
|
||||||
"https://gitlab.freedesktop.org/",
|
gl = gitlab.Gitlab(server,
|
||||||
private_token=os.environ.get('GITLAB_API_TOKEN'),
|
private_token=os.environ.get('GITLAB_API_TOKEN'),
|
||||||
job_token=os.environ.get('CI_JOB_TOKEN')
|
job_token=os.environ.get('CI_JOB_TOKEN'))
|
||||||
)
|
|
||||||
|
|
||||||
cerbero = gl.projects.get(CERBERO_ID)
|
cerbero = gl.projects.get(CERBERO_PROJECT)
|
||||||
pipe = cerbero.trigger_pipeline(
|
pipe = cerbero.trigger_pipeline(
|
||||||
token=os.environ['CI_JOB_TOKEN'],
|
token=os.environ['CI_JOB_TOKEN'],
|
||||||
ref=os.environ["GST_UPSTREAM_BRANCH"],
|
ref=os.environ["GST_UPSTREAM_BRANCH"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user