summaryrefslogtreecommitdiff
path: root/doc/Jenkinsfile.kernel-example
blob: 92e3f05bb88ae553794c33e8dced583fa30fcaea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Example Jenkinsfile for building the Linux kernel
// Uses the custom kernel-builder image (jenkins/kernel-builder/Dockerfile)
// Build the image first: docker build -t kernel-builder jenkins/kernel-builder/
//
// NOTE: When using "Pipeline script from SCM", Jenkins clones the repo
// automatically before running this file. No checkout stage is needed.
// Configure shallow clone + extended timeout in the job's SCM settings
// for large repos (see doc/jenkins-cpp-build.md, section 4).

pipeline {
    agent {
        docker { image 'kernel-builder' }
    }

    options {
        timeout(time: 4, unit: 'HOURS')
    }

    stages {
        stage('Build') {
            steps {
                sh 'make defconfig'
                sh 'make -j$(nproc)'
            }
        }

        stage('Archive') {
            steps {
                archiveArtifacts artifacts: 'arch/x86/boot/bzImage', fingerprint: true
            }
        }
    }
}