aboutsummaryrefslogtreecommitdiffstats
path: root/Jenkinsfile.mainline
blob: 3a106057ec8711622f0509365bc2b0949d39f979 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env groovy
/*
 * job name: kernel-mainline
 */

def KernelSource() {
    dir ('source') {
	checkout([
	    $class: 'GitSCM',
	    branches: [
		[ name: '*/linux-5.9.y' ]
	    ],
	    extensions: [
		[
		    $class: 'CloneOption',
		    timeout: 60
		]
	    ],
	    userRemoteConfigs: [
		[ url: 'git://spunk.home.kraxel.org/linux-stable' ]
	    ]])
    }
}

def KernelRPMBuild() {
    sh '''
	scripts/prepare-kernel.sh
	yum-builddep -y kernel.spec
	scripts/rpm-build.sh -ba kernel.spec
	createrepo rpms
	'''
    archiveArtifacts 'rpms/*/*'
}

pipeline {
    agent {
        kubernetes {
            yamlFile 'centos7-rpmbuild.yaml'
            defaultContainer 'centos7-rpmbuild'
            slaveConnectTimeout '3600'
            nodeSelector 'kubernetes.io/os=linux,kubernetes.io/arch=amd64'
        }
    }

    options {
	buildDiscarder(logRotator(numToKeepStr: '5'))
	disableConcurrentBuilds()
    }

    triggers {
	pollSCM('H * * * *')
    }

    stages {

	stage ('Prepare') {
	    steps {
		KernelSource();
	    }
	}

	stage ("RPM Build") {
	    steps {
		KernelRPMBuild()
	    }
	}

    }
}