Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab-ci
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Clea OS
infrastructure
gitlab-ci
Commits
63279799
Commit
63279799
authored
3 years ago
by
Tim Jaacks
Browse files
Options
Downloads
Patches
Plain Diff
deploy_gitlab_ci: trigger pipeline only if it has not run before
parent
4c6b4621
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
deploy_gitlab_ci.py
+8
-7
8 additions, 7 deletions
deploy_gitlab_ci.py
with
8 additions
and
7 deletions
deploy_gitlab_ci.py
+
8
−
7
View file @
63279799
...
@@ -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
(
...
...
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