2018-08-04 13:23:46 -03:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent none
|
|
|
|
stages {
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
def build_nodes = [:]
|
|
|
|
def docker_images = [
|
2019-02-10 18:33:17 -04:00
|
|
|
armhf: "px4io/px4-dev-armhf:2019-02-09",
|
|
|
|
base: "px4io/px4-dev-base:2019-02-09",
|
|
|
|
nuttx: "px4io/px4-dev-nuttx:2019-02-09",
|
2019-02-18 11:52:02 -04:00
|
|
|
ros: "px4io/px4-dev-ros-kinetic:2019-02-14",
|
2019-02-10 18:33:17 -04:00
|
|
|
rpi: "px4io/px4-dev-raspi:2019-02-09",
|
2018-09-12 10:53:11 -03:00
|
|
|
snapdragon: "lorenzmeier/px4-dev-snapdragon:2018-09-12"
|
2018-08-04 13:23:46 -03:00
|
|
|
]
|
|
|
|
|
|
|
|
def armhf_builds = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["aerotenna_ocpoc_ubuntu"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.armhf,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def base_builds = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["px4_sitl_rtps"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.base,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def nuttx_builds_archive = [
|
2019-02-05 20:53:54 -04:00
|
|
|
target: [
|
|
|
|
"px4_fmu-v2_default", "px4_fmu-v2_fixedwing", "px4_fmu-v2_lpe", "px4_fmu-v2_multicopter", "px4_fmu-v2_rover", "px4_fmu-v2_test",
|
|
|
|
"px4_fmu-v3_default",
|
|
|
|
"px4_fmu-v4_default",
|
|
|
|
"px4_fmu-v4pro_default",
|
|
|
|
"px4_fmu-v5_default", "px4_fmu-v5_fixedwing", "px4_fmu-v5_multicopter", "px4_fmu-v5_rover", "px4_fmu-v5_rtps", "px4_fmu-v5_stackcheck",
|
2019-02-12 21:53:45 -04:00
|
|
|
"intel_aerofc-v1_default", "auav_x21_default", "av_x-v1_default", "bitcraze_crazyflie_default", "airmind_mindpx-v2_default",
|
2018-11-28 13:13:21 -04:00
|
|
|
"nxp_fmuk66-v3_default", "omnibus_f4sd_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.nuttx,
|
|
|
|
archive: true
|
|
|
|
]
|
|
|
|
|
|
|
|
def nuttx_builds_other = [
|
2019-01-25 11:04:04 -04:00
|
|
|
target: ["px4_cannode-v1_default", "px4_esc-v1_default", "thiemar_s2740vc-v1_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.nuttx,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def rpi_builds = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["emlid_navio2_cross", "parrot_bebop_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.rpi,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def snapdragon_builds = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["atlflight_eagle_qurt-default", "atlflight_eagle_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.snapdragon,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def docker_builds = [
|
2019-01-28 14:08:58 -04:00
|
|
|
armhf_builds, base_builds, nuttx_builds_archive, nuttx_builds_other, rpi_builds, snapdragon_builds
|
2018-08-04 13:23:46 -03:00
|
|
|
]
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// TODO: actually upload artifacts to S3
|
|
|
|
stage('S3 Upload') {
|
|
|
|
agent {
|
2019-02-10 18:33:17 -04:00
|
|
|
docker { image 'px4io/px4-dev-base:2019-02-09' }
|
2018-08-04 13:23:46 -03:00
|
|
|
}
|
|
|
|
options {
|
|
|
|
skipDefaultCheckout()
|
|
|
|
}
|
|
|
|
when {
|
|
|
|
anyOf {
|
|
|
|
branch 'master'
|
|
|
|
branch 'beta'
|
|
|
|
branch 'stable'
|
|
|
|
branch 'pr-jenkins' // for testing
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'echo "uploading to S3"'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // stages
|
|
|
|
environment {
|
|
|
|
CCACHE_DIR = '/tmp/ccache'
|
|
|
|
CI = true
|
|
|
|
}
|
|
|
|
options {
|
2019-01-19 13:00:51 -04:00
|
|
|
buildDiscarder(logRotator(numToKeepStr: '2', artifactDaysToKeepStr: '14'))
|
2018-08-04 13:23:46 -03:00
|
|
|
timeout(time: 60, unit: 'MINUTES')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def createBuildNode(Boolean archive, String docker_image, String target) {
|
|
|
|
return {
|
2019-01-29 10:48:24 -04:00
|
|
|
|
|
|
|
// TODO: fix the snapdragon image
|
|
|
|
bypass_entrypoint = ''
|
|
|
|
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2018-09-12') {
|
|
|
|
bypass_entrypoint = ' --entrypoint=""'
|
|
|
|
}
|
|
|
|
|
2018-08-04 13:23:46 -03:00
|
|
|
node {
|
|
|
|
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
|
2019-01-29 10:48:24 -04:00
|
|
|
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw' + bypass_entrypoint) {
|
2018-08-04 13:23:46 -03:00
|
|
|
stage(target) {
|
|
|
|
try {
|
|
|
|
sh('export')
|
|
|
|
checkout(scm)
|
|
|
|
sh('make distclean')
|
|
|
|
sh('git fetch --tags')
|
|
|
|
sh('ccache -z')
|
|
|
|
sh('make ' + target)
|
|
|
|
sh('ccache -s')
|
|
|
|
sh('make sizes')
|
|
|
|
if (archive) {
|
2018-12-02 13:59:35 -04:00
|
|
|
archiveArtifacts(allowEmptyArchive: false, artifacts: 'build/*/*.px4, build/*/*.elf, build/*/*.bin', fingerprint: true, onlyIfSuccessful: true)
|
2018-08-04 13:23:46 -03:00
|
|
|
}
|
2018-08-29 13:31:14 -03:00
|
|
|
sh('make ' + target + ' package')
|
|
|
|
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.tar.bz2', fingerprint: true, onlyIfSuccessful: true)
|
|
|
|
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.deb', fingerprint: true, onlyIfSuccessful: true)
|
2018-08-04 13:23:46 -03:00
|
|
|
}
|
|
|
|
catch (exc) {
|
|
|
|
throw (exc)
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
sh('make distclean')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|