gitlab-ci
GitLab CI scripts
This repository contains scripts for Yocto infrastructure tasks, e.g. automatic integration of project changes into the manifest. It is meant to be included into all relevant Yocto repositories as a git submodule.
GITBOT_TOKEN
Providing The scripts need a personal GitLab access token of a user with access to all relevant repositories (manifest and all contained projects) in order to work correctly. We have created the @guf-gitbot user for this task. Norman and Tim know the login credentials for it. These should not be needed, though, as the user is member of the Garz & Fricke group and thus already has access to all group projects. However, everyone can add the user as a member to every project he has access to, if needed.
The personal access token of the @guf-gitbot user has to be provided on each repository
via the CI environment variable GITBOT_TOKEN
(set under project's settings -> CI/CD
-> Variables). Its value can be read on projects which already have this variable
defined.
Workflow to add a repository to SRCREV.conv for reproducible bitbake builds
Some bitbake recipes are set to SRCREV = "${AUTOREV}"
. To enable reproducible
builds, the current revision is written to the SRCREV.conf file. This file is
part of the manifest repo, which is used for release tags. This workflow adds
the a gitlab pipeline to the project that automatically sets the current
version in the SRCREV.conf file.
- Add the gitlab-ci repo as submodule to the project by using the correct relative path
git submodule add ../../yocto/infrastructure/gitlab-ci .gitlab-ci
- Add an approriate .gitlab-ci.yml file. For example, copy it from the repository
egalxi2c. Modify the following variables in the file:
- MASTER_BRANCH_PROJECT: Set the project master branch
- BB_RECIPE_NAME: Set the name of the bitbake recipe
- Create a corresponding entry in the SRCREV.conf file of the manifest repo
SRCREV_pn-<bitbake-recipe> = "<current-commit-hash>"
Repository settings
- Verify that the merge strategy is set to Fast-forward merge (General -> Merge requests -> Merge method)
- Enable the CI/CD functionality for the repository (General -> Visibility, project features, permissions -> CI/CD)
- Check that the default branch is protected and that Maintainers + Developers are allowed to merge (Repository -> Protected branches)