-
Notifications
You must be signed in to change notification settings - Fork 550
/
Jenkinsfile
115 lines (104 loc) · 3.38 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('Build') {
steps {
script {
def build_nodes = [:]
def docker_images = [
nuttx: "px4io/px4-dev-nuttx:2019-02-14",
]
def nuttx_builds_archive = [
target: [
"aerofcv1_bl",
"auavx2v1_bl",
"avx_v1_bl",
"crazyflie21_bl",
"crazyflie_bl",
"cube_f4_bl",
"fmuk66e_bl",
"fmuk66v3_bl",
"kakutef7_bl",
"mindpxv2_bl",
"modalai_fc_v1_bl",
"modalai_voxl2_io_bl",
"omnibusf4sd_bl",
"pix32v5_bl",
"px4aerocore_bl",
"px4discovery_bl",
"px4flow_bl",
"px4fmu_bl",
"px4fmuv2_bl",
"px4fmuv3_bl",
"px4fmuv4_bl",
"px4fmuv4pro_bl",
"px4fmuv5_bl",
"px4fmuv5x_bl",
"px4io_bl",
"px4iov3_bl",
"smartap_airlink_bl",
"smartap_pro_bl",
"tapv1_bl",
"uvify_core_bl",
"thepeach_k1_bl",
"thepeach_r1_bl",
],
image: docker_images.nuttx,
archive: true
]
def docker_builds = [
nuttx_builds_archive
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
for (def build_target = 0; build_target < docker_builds[build_type].target.size(); build_target++) {
build_nodes.put(docker_builds[build_type].target[build_target],
createBuildNode(docker_builds[build_type].archive, docker_builds[build_type].image, docker_builds[build_type].target[build_target])
)
}
}
parallel build_nodes
} // script
} // steps
} // stage Build
} // stages
environment {
CCACHE_DIR = '/tmp/ccache'
CI = true
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '28'))
timeout(time: 60, unit: 'MINUTES')
}
}
def createBuildNode(Boolean archive, String docker_image, String target) {
return {
node {
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
stage(target) {
try {
sh('export')
checkout(scm)
sh('git clean -ff -x -d .')
sh('git submodule update --init --recursive --force')
sh('git fetch --tags')
sh('ccache -z')
sh('make ' + target)
sh('ccache -s')
sh('make sizes')
if (archive) {
archiveArtifacts(allowEmptyArchive: false, artifacts: 'build/*/*.elf, build/*/*.bin, build/*/*.hex', fingerprint: true, onlyIfSuccessful: true)
}
}
catch (exc) {
throw (exc)
}
finally {
sh('git submodule deinit -f .')
sh('git clean -ff -x -d .')
}
}
}
}
}
}