Skip to content
Snippets Groups Projects
Commit 63279799 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

deploy_gitlab_ci: trigger pipeline only if it has not run before

parent 4c6b4621
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,7 @@ def main(): ...@@ -64,7 +64,7 @@ def main():
project = common.get_project(gitlab, args.project) project = common.get_project(gitlab, args.project)
# Update submodule # Update submodule
integration_branch, _, submodule_project = update_submodule( integration_branch, integration_commit, submodule_project = update_submodule(
project, args.submodule, args.revision, args.branch project, args.submodule, args.revision, args.branch
) )
...@@ -91,12 +91,13 @@ def main(): ...@@ -91,12 +91,13 @@ def main():
else: else:
print("Existing integration merge request:\n%s" % mr.web_url) print("Existing integration merge request:\n%s" % mr.web_url)
# Explicitly trigger a pipeline on the integration branch (automatic pipelines are # Explicitly trigger a pipeline on the integration branch if it has not run for the
# disabled for integration merge requests) # head commit yet (automatic pipelines are disabled for integration branches)
try: if not project.pipelines.list(sha=integration_commit):
project.pipelines.create({"ref": integration_branch}) try:
except GitlabCreateError as e: project.pipelines.create({"ref": integration_branch})
sys.exit("ERROR: could not create merge request pipeline: %s" % e) except GitlabCreateError as e:
sys.exit("ERROR: could not create merge request pipeline: %s" % e)
if not args.merge: if not args.merge:
print( print(
......
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