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
285ce195
Commit
285ce195
authored
3 years ago
by
Jonas Höppner
Browse files
Options
Downloads
Patches
Plain Diff
CI: Merge_into_manifest: Fixes for merge detection
parent
ce59c409
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+11
-7
11 additions, 7 deletions
.gitlab-ci.yml
common.yml
+1
-0
1 addition, 0 deletions
common.yml
foobar-manifest-integration.yml
+1
-0
1 addition, 0 deletions
foobar-manifest-integration.yml
merge_into_manifest.py
+11
-1
11 additions, 1 deletion
merge_into_manifest.py
with
24 additions
and
8 deletions
.gitlab-ci.yml
+
11
−
7
View file @
285ce195
...
...
@@ -125,6 +125,8 @@ deploy:
extends
:
-
.deploy
-
.manifest-projects
rules
:
-
when
:
never
deploy-foobar
:
extends
:
...
...
@@ -134,6 +136,7 @@ deploy-foobar:
trigger
:
stage
:
deploy
rules
:
-
when
:
never
-
if
:
$CI_MERGE_REQUEST_IID
needs
:
[
deploy
]
trigger
:
...
...
@@ -194,13 +197,13 @@ check:
-
MERGE_REQUEST="${CI_MERGE_REQUEST_IID}";
-
MASTER_BRANCH=dunfell
-
./check_if_integration_branch_is_up_to_date.py
--gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN}
--manifest-project=${CI_PROJECT_ROOT_NAMESPACE}/yocto/manifest
--integration-base=${MASTER_BRANCH}
--project=${CI_PROJECT_PATH}
--merge-request=${CI_MERGE_REQUEST_IID}
#
- ./check_if_integration_branch_is_up_to_date.py
#
--gitlab-url=${CI_SERVER_URL}
#
--token=${GITBOT_TOKEN}
#
--manifest-project=${CI_PROJECT_ROOT_NAMESPACE}/yocto/manifest
#
--integration-base=${MASTER_BRANCH}
#
--project=${CI_PROJECT_PATH}
#
--merge-request=${CI_MERGE_REQUEST_IID}
# The check is done for both manifests in one job as the retrigger
# looks for jobs named check, though there can only be one
...
...
@@ -212,3 +215,4 @@ check:
--integration-base=master
--project=${CI_PROJECT_PATH}
--merge-request=${CI_MERGE_REQUEST_IID}
--verbose
This diff is collapsed.
Click to expand it.
common.yml
+
1
−
0
View file @
285ce195
...
...
@@ -79,4 +79,5 @@ yamllint:
--integration-base=${MASTER_BRANCH_MANIFEST}
--project=${CI_PROJECT_PATH}
--merge-request=${MERGE_REQUEST}
--verbose
${PARENT_MR}
This diff is collapsed.
Click to expand it.
foobar-manifest-integration.yml
+
1
−
0
View file @
285ce195
...
...
@@ -111,6 +111,7 @@ merge:
--commit=${CI_COMMIT_SHA}
--save-revision-to=manifest_revision
--recipe-name=${BB_RECIPE_NAME}
--verbose
artifacts
:
paths
:
-
manifest_revision
...
...
This diff is collapsed.
Click to expand it.
merge_into_manifest.py
+
11
−
1
View file @
285ce195
...
...
@@ -2,6 +2,7 @@
import
common
import
argparse
import
logging
import
sys
import
time
from
gitlab
import
Gitlab
...
...
@@ -37,9 +38,10 @@ def merge_into_manifest(
recipe_name
=
recipe_name
,
srcrev_file
=
srcrev_file
,
)
logging
.
debug
(
current_revisions
)
# This commit is contained there if current_revisions contains
# it directly or any parrent of current_revisions is commit
for
rev
in
current_revisions
:
for
rev
in
current_revisions
.
values
()
:
if
common
.
is_commit_parent_of_project_commit
(
project
,
rev
,
commit
):
print
(
"
Commit {} is already merged into {}
"
.
format
(
...
...
@@ -191,8 +193,16 @@ def main():
dest
=
"
revision_file
"
,
required
=
False
,
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
action
=
"
store_true
"
,
help
=
"""
Increase verbosity.
"""
,
)
args
,
_
=
parser
.
parse_known_args
()
if
args
.
verbose
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
gitlab
=
Gitlab
(
args
.
gitlab_url
,
private_token
=
args
.
token
)
project
=
common
.
get_project
(
gitlab
,
args
.
project
)
...
...
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