Skip to content

sys-kernel/xanmod-kernel: add CI for package building

Max Lübke requested to merge SoBC47/src_prepare-overlay:kernel-ci into master

As already announced by two closed merge requests I tried to implement a pipeline stage to automatically build and deploy xanmod-kernel in preparation for a xanmod-kernel-bin package as requested in #39.

This is done by two jobs, build and deploy, which will only run if ebuild files in the package directory changes and a merge request is opened.

The build job will:

  1. create PKGDIR, which is set as global variable
  2. run added build script, which creates a list of changed files using git-diff and runs ebuild with each of those files
  3. add PKGDIR as artifact for deploy job

To provide a tool chain for package creation a modified gentoo-stage3 image is used.

The deploy job will:

  1. add ssh private key to ssh-agent and add given server to known_hosts
  2. run added deploy script to scp all .gpkg.tar files from artifacts to destination server

In order to run properly the following gitlab variables must be set:

  • KERNEL_SSH_ADDRESS - address or ip of the deploy server
  • KERNEL_SSH_BASE_DIR - web/deploy servers base directory
  • KERNEL_SSH_KNOWN_HOSTS - ssh fingerprint
  • KERNEL_SSH_PORT - ssh port
  • KERNEL_SSH_PRIVATE_KEY - private ssh key used for authentication
  • KERNEL_SSH_USER - ssh user

An example instance

I know the building process of the kernel will take quite much time. For this (and also for this project at all) I could provide a runner and also the storage with web server etc. which can be found here.

Of course everything is still open and can be adapted to wishes. I appreciate every feedback and help 🙂

ML

Merge request reports