-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
92 lines (88 loc) · 2.24 KB
/
Jenkinsfile
File metadata and controls
92 lines (88 loc) · 2.24 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pipeline {
agent {
label 'os-ubuntu2004'
}
environment {
http_proxy = credentials('proxy')
https_proxy = credentials('proxy')
}
options {
skipDefaultCheckout()
}
stages {
stage('Prepare') {
steps {
/* Increase apt lock file timeout not to fail directly if another job is running apt too */
sh 'echo "DPkg::Lock::Timeout \"60\";" | sudo tee /etc/apt/apt.conf.d/99timeout'
/*
* Checkout in a subfolder, as debian packaging
* tools require to output on '..'.
*/
dir('pristine') {
checkout scm
sh 'sudo -E apt-get update'
sh 'sudo -E apt-get --fix-broken install -y'
sh 'sudo -E apt-get install linux-headers-generic dkms equivs devscripts -y' // debian package
sh 'sudo -E apt-get install python3-ply python3-git -y' // checkpatch
// Remove old kernels
sh 'sudo -E apt-get autoremove -y'
}
}
}
stage('Build') {
steps {
dir('pristine') {
sh 'make KDIR=/lib/modules/$(ls /lib/modules/)/build'
}
}
}
stage('Check') {
steps {
dir('pristine') {
sh 'find -name "*.c" -not -name "*mod.c" -not -path "*debian*" -print0 | xargs -0 /usr/src/linux-headers-$(ls /lib/modules/)/scripts/checkpatch.pl --no-tree --max-line-length=80 --strict --ignore=LINUX_VERSION_CODE --ignore=UNDOCUMENTED_DT_STRING -f'
}
}
}
stage('Package') {
when {
environment name: 'BRANCH_NAME', value: 'debian'
}
steps {
dir('pristine') {
script {
sh 'dpkg-buildpackage -us -uc -b'
sh 'lintian || true'
}
}
script {
rtUpload (
serverId: 'artifactory-azure',
spec: '''{
"files": [
{
"pattern": "vd56g3*.deb",
"target": "imgswlinux-debian-local/pool/vd56g3-dkms/stable/",
"props": "deb.distribution=stable;deb.component=main;deb.architecture=armhf;deb.architecture=arm64"
}
]
}''',
failNoOp: true
)
}
}
}
}
post {
always {
// Remove debian packaging stuff
sh 'find . -maxdepth 1 -type f -name "vd56g3*" -exec rm -v "{}" \\;'
// Send mail
emailext (
subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [[$class: 'DevelopersRecipientProvider']],
replyTo: '$DEFAULT_REPLYTO'
)
}
}
}