Skip to content

jenkins

Tom edited this page Aug 8, 2019 · 1 revision

Iso jenkins

If you want to build the iso using jenkins you need to do a few things.

Add a jenkins node to your jenkins build. The node must be running arch linux (with the latest kernel). Otherwise the iso build will always fail.

The jenkinsfile for the iso build is located here toslive/Jenkinsfile

Specifiy your node

// should be your archlinux node
node('archlinux') {
// stages here
} 

The important part is this.

stage('server'){
        try {
            sh "cd toslive && sudo ./start.sh -s" // run start.sh as a root user since the live iso chroot is a root user
         } catch(error) {
            echo "First build failed, let's retry."
            echo "This probably happend because our repository has been updated"
            retry(2) {
               sh "cd toslive && sudo ./start.sh -s"
            }
         }
    }

This will build one iso image in this case the server image. The reason we use try{}catch{} is to make sure our build is succesful after a repo update.

Since our iso's are build after the repository is refreshed the pull can bork an install (if we are changing packages on the repo and the iso is beeing build on that moment we can have broken packages)

The try catch takes care of this.

Repo jenkins

The repo must also be build on arch linux based systems

Make sure the node is also arch based

stage('building tarballs'){
        parallel(
          apps: {
            sh "cd repo && sh build.sh -a"
          },
          fonts: {
            sh "cd repo && sh build.sh -f"
          }
          )
    }

This part of the jenkinsfile build all software (without interactive prompts)

Currenlty the kernel is not beeing build via jenkins because we get interrupt errors (due to builds taking to long)

You will manually have to ssh into the node and build the kernel manually.

cd $jenkinsdir
./build -k $cores # $cores is the amount of cores your cpu has

Change upload.sh to your server.

Don't upload your repository if it doesn't include the tos kernel. Otherwise the iso's will fail because they can't find there kernels

Clone this wiki locally