Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Kontron Electronics GmbH Yocto BSP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
KED Software Projects
KED
Kontron Electronics GmbH Yocto BSP
Commits
9c04c449
Commit
9c04c449
authored
2 years ago
by
Frieder Schrempf
Browse files
Options
Downloads
Patches
Plain Diff
ci: Add upgrade recipe job
parent
6d87271e
No related branches found
No related tags found
1 merge request
!9
Draft: Upgrade Recipe Bot
Pipeline
#15849
passed
2 years ago
Stage: build-container
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+16
-0
16 additions, 0 deletions
.gitlab-ci.yml
ci/recipe-upgrade.yml
+60
-0
60 additions, 0 deletions
ci/recipe-upgrade.yml
with
76 additions
and
0 deletions
.gitlab-ci.yml
+
16
−
0
View file @
9c04c449
include
:
-
'
/ci/build.yml'
-
'
/ci/container-build.yml'
-
'
/ci/recipe-upgrade.yml'
stages
:
-
build-container
-
build
-
maintenance
variables
:
KAS_CONFIG
:
"
kas/ktn-${PLATFORM}.yml:kas/series/${YOCTO_SERIES}.yml"
...
...
@@ -44,3 +46,17 @@ container:build:
container:build-deploy
:
extends
:
.build-deploy-container
<<
:
*container-vars
# Upgrade Recipes
.upgrade-recipe-matrix
:
&upgrade-recipe-matrix
-
RECIPE
:
u-boot-ktn
LAYER
:
meta-ktn-imx
PLATFORM
:
mx8mm
YOCTO_SERIES
:
kirkstone
ASSIGNEE
:
fschrempf
bsp:upgrade-recipes
:
extends
:
.recipe-upgrade
parallel
:
matrix
:
*upgrade-recipe-matrix
This diff is collapsed.
Click to expand it.
ci/recipe-upgrade.yml
0 → 100644
+
60
−
0
View file @
9c04c449
#
# This is a template for the recipe upgrade job that uses devtool to upgrade a
# recipe to the latest version available in the upstream repo and create a MR
# for this change.
#
.recipe-upgrade
:
tags
:
-
server
stage
:
maintenance
image
:
$BUILD_IMAGE
rules
:
-
if
:
'
($CI_PIPELINE_SOURCE
==
"schedule"
||
$CI_PIPELINE_SOURCE
==
"web")'
when
:
always
-
when
:
never
variables
:
RECIPE
:
"
"
LAYER
:
"
"
FEAT_BRANCH
:
feature/${CI_COMMIT_REF_NAME}/upgrade-$RECIPE
REVIEWER
:
"
"
ASSIGNEE
:
"
"
before_script
:
-
git config --global user.email "upgrade-bot@${CI_SERVER_HOST}"
-
git config --global user.name "Upgrade Bot"
script
:
-
git branch -D ${FEAT_BRANCH} ||
true
-
git checkout -b ${FEAT_BRANCH}
-
|
kas shell -c " \
devtool upgrade --no-patch --no-overrides $RECIPE && \
devtool finish --mode srcrev --no-overrides --remove-work $RECIPE $LAYER" \
$KAS_CONFIG:kas/dev/shared-cache.yml
-
git add .
-
'
git
commit
-m
"$LAYER:
$RECIPE:
Upgrade
to
latest
revision"'
-
git push --force https://upgrade-bot:${PROJECT_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}
-
|
# get the id of the assignee username
if [ -n "$ASSIGNEE" ]; then
ASSIGNEE_ID=$(gitlab -o json --server-url ${CI_SERVER_URL} \
--private-token ${PROJECT_ACCESS_TOKEN} \
user list \
--username $ASSIGNEE | jq .[0].id)
MR_PARAMS="--assignee-id $ASSIGNEE_ID"
fi
-
|
# get the id of the reviewer username
if [ -n "$REVIEWER" ]; then
REVIEWER_ID=$(gitlab -o json --server-url ${CI_SERVER_URL} \
--private-token ${PROJECT_ACCESS_TOKEN} \
user list \
--username $REVIEWER | jq .[0].id)
MR_PARAMS="$MR_PARAMS --reviewer-id $REVIEWER_ID"
fi
-
|
gitlab --server-url ${CI_SERVER_URL} \
--private-token ${PROJECT_ACCESS_TOKEN} \
project-merge-request create \
--project-id ${CI_PROJECT_PATH} \
--source-branch ${FEAT_BRANCH} \
--target-branch ${CI_COMMIT_REF_NAME} \
--remove-source-branch true \
$MR_PARAMS \
--title "🤖 Upgrade Bot: Upgrade ${RECIPE} to latest revision"
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