forked from flightaware/dump978
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
69 lines (61 loc) · 2.29 KB
/
Jenkinsfile
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
node(label: 'raspberrypi') {
properties([
disableConcurrentBuilds(),
durabilityHint(hint: 'PERFORMANCE_OPTIMIZED')
])
def srcdir = "${WORKSPACE}/src"
stage('Checkout') {
sh "rm -fr ${srcdir}"
sh "mkdir ${srcdir}"
dir(srcdir) {
checkout scm
}
}
def dist_arch_list = [
["bookworm", "armhf"],
["bookworm", "arm64"],
["bullseye", "armhf"],
["bullseye", "arm64"],
["buster", "armhf"]
]
def pkgdirs = [:]
def resultdirs = [:]
for (int i = 0; i < dist_arch_list.size(); ++i) {
def dist_and_arch = dist_arch_list[i]
def dist = dist_and_arch[0]
def arch = dist_and_arch[1]
String pkgdir
if (pkgdirs.containsKey(dist)) {
pkgdir = pkgdirs[dist]
} else {
pkgdir = "pkg-${dist}"
stage("Prepare source for ${dist}") {
sh "rm -fr ${pkgdir}"
sh "${srcdir}/prepare-build.sh ${dist} ${pkgdir}"
}
pkgdirs[dist] = pkgdir
}
def resultdir = "results-${dist}-${arch}"
resultdirs[dist_and_arch] = resultdir
stage("Build for ${dist} (${arch})") {
sh "rm -fr ${resultdir}"
sh "mkdir -p ${resultdir}"
dir(pkgdir) {
sh "DIST=${dist} BRANCH=${env.BRANCH_NAME} ARCH=${arch} pdebuild --use-pdebuild-internal --debbuildopts -b --buildresult ${WORKSPACE}/${resultdir} -- --override-config"
}
archiveArtifacts artifacts: "${resultdir}/*.deb", fingerprint: true
}
stage("Test install on ${dist} (${arch})") {
sh "BRANCH=${env.BRANCH_NAME} ARCH=${arch} /build/pi-builder/scripts/validate-packages.sh ${dist} ${resultdir}/dump978-fa_*.deb ${resultdir}/skyaware978_*.deb ${resultdir}/skyview978_*.deb"
}
}
stage('Deploy to internal repository') {
for (int i = 0; i < dist_arch_list.size(); ++i) {
def dist_and_arch = dist_arch_list[i]
def dist = dist_and_arch[0]
def arch = dist_and_arch[1]
def resultdir = resultdirs[dist_and_arch]
sh "/build/pi-builder/scripts/deploy.sh -distribution ${dist} -architectures ${arch} -branch ${env.BRANCH_NAME} ${resultdir}/*.deb"
}
}
}