Skip to content
Snippets Groups Projects

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.

Providing GITBOT_TOKEN

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.

  1. 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
  2. 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
  3. Create a corresponding entry in the SRCREV.conf file of the manifest repo
    SRCREV_pn-<bitbake-recipe> = "<current-commit-hash>"

Repository settings

  1. Verify that the merge strategy is set to Fast-forward merge (General -> Merge requests -> Merge method)
  2. Enable the CI/CD functionality for the repository (General -> Visibility, project features, permissions -> CI/CD)
  3. Check that the default branch is protected and that Maintainers + Developers are allowed to merge (Repository -> Protected branches)