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:
Xavier Claessens 2021-10-05 11:20:32 -04:00 committed by GStreamer Marge Bot
parent 01cfc1ee7e
commit d4296b7d3d

View file

@ -5,7 +5,8 @@ import os
import sys
import gitlab
CERBERO_ID = 1340
CERBERO_PROJECT = 'gstreamer/cerbero'
class Status:
@ -33,13 +34,12 @@ def fprint(msg):
if __name__ == "__main__":
gl = gitlab.Gitlab(
"https://gitlab.freedesktop.org/",
server = os.environ['CI_SERVER_URL']
gl = gitlab.Gitlab(server,
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(
token=os.environ['CI_JOB_TOKEN'],
ref=os.environ["GST_UPSTREAM_BRANCH"],