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 = [
|
2021-05-02 13:33:51 -03:00
|
|
|
armhf: "px4io/px4-dev-armhf:2021-04-29",
|
|
|
|
arm64: "px4io/px4-dev-aarch64:2021-04-29",
|
|
|
|
base: "px4io/px4-dev-base-bionic:2021-04-29",
|
|
|
|
nuttx: "px4io/px4-dev-nuttx-focal:2021-04-29",
|
2020-04-02 07:23:40 -03:00
|
|
|
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
|
2018-08-04 13:23:46 -03:00
|
|
|
]
|
|
|
|
|
|
|
|
def armhf_builds = [
|
2021-02-26 16:14:21 -04:00
|
|
|
target: ["beaglebone_blue_default", "emlid_navio2_default", "px4_raspberrypi_default", "scumaker_pilotpi_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.armhf,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
2020-11-10 12:04:47 -04:00
|
|
|
def arm64_builds = [
|
|
|
|
target: ["scumaker_pilotpi_arm64"],
|
|
|
|
image: docker_images.arm64,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
2018-08-04 13:23:46 -03:00
|
|
|
def base_builds = [
|
2019-04-10 13:25:27 -03: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: [
|
2020-01-22 15:58:57 -04:00
|
|
|
"airmind_mindpx-v2_default",
|
2021-02-18 12:01:16 -04:00
|
|
|
"ark_can-flow_canbootloader",
|
2021-01-27 22:17:40 -04:00
|
|
|
"ark_can-flow_default",
|
2020-01-22 15:58:57 -04:00
|
|
|
"av_x-v1_default",
|
|
|
|
"bitcraze_crazyflie_default",
|
2020-12-26 11:48:30 -04:00
|
|
|
"bitcraze_crazyflie21_default",
|
2020-09-23 15:30:54 -03:00
|
|
|
"cuav_can-gps-v1_canbootloader",
|
|
|
|
"cuav_can-gps-v1_default",
|
2020-08-12 14:02:16 -03:00
|
|
|
"cuav_nora_default",
|
2020-05-01 21:59:28 -03:00
|
|
|
"cuav_x7pro_default",
|
2020-07-26 14:55:41 -03:00
|
|
|
"cubepilot_cubeorange_default",
|
|
|
|
"cubepilot_cubeyellow_default",
|
2021-02-18 12:01:16 -04:00
|
|
|
"holybro_can-gps-v1_canbootloader",
|
|
|
|
"holybro_can-gps-v1_default",
|
2020-02-16 13:11:54 -04:00
|
|
|
"holybro_durandal-v1_default",
|
2020-08-09 12:48:38 -03:00
|
|
|
"holybro_kakutef7_default",
|
|
|
|
"holybro_pix32v5_default",
|
2020-01-22 15:58:57 -04:00
|
|
|
"modalai_fc-v1_default",
|
2021-04-05 16:25:20 -03:00
|
|
|
"modalai_fc-v1_rtps",
|
2020-02-16 13:11:54 -04:00
|
|
|
"mro_ctrl-zero-f7_default",
|
2021-02-24 13:22:31 -04:00
|
|
|
"mro_ctrl-zero-f7-oem_default",
|
|
|
|
"mro_ctrl-zero-h7_default",
|
|
|
|
"mro_ctrl-zero-h7-oem_default",
|
2020-12-27 13:12:15 -04:00
|
|
|
"mro_pixracerpro_default",
|
2020-02-16 13:11:54 -04:00
|
|
|
"mro_x21-777_default",
|
|
|
|
"mro_x21_default",
|
2021-02-18 12:01:16 -04:00
|
|
|
"nxp_fmuk66-e_default",
|
2021-03-02 13:05:19 -04:00
|
|
|
"nxp_fmuk66-e_rtps",
|
|
|
|
"nxp_fmuk66-e_socketcan",
|
2020-01-22 15:58:57 -04:00
|
|
|
"nxp_fmuk66-v3_default",
|
2020-09-16 04:32:08 -03:00
|
|
|
"nxp_fmuk66-v3_rtps",
|
2021-01-10 23:02:24 -04:00
|
|
|
"nxp_fmuk66-v3_socketcan",
|
2019-12-04 14:59:47 -04:00
|
|
|
"nxp_fmurt1062-v1_default",
|
2020-11-03 17:14:53 -04:00
|
|
|
"nxp_ucans32k146_default",
|
2021-03-23 08:00:17 -03:00
|
|
|
"nxp_ucans32k146_canbootloader",
|
2020-01-22 15:58:57 -04:00
|
|
|
"omnibus_f4sd_default",
|
2020-02-16 13:11:54 -04:00
|
|
|
"px4_fmu-v2_default",
|
|
|
|
"px4_fmu-v2_fixedwing",
|
|
|
|
"px4_fmu-v2_multicopter",
|
|
|
|
"px4_fmu-v2_rover",
|
2019-02-05 20:53:54 -04:00
|
|
|
"px4_fmu-v3_default",
|
2020-02-16 13:11:54 -04:00
|
|
|
"px4_fmu-v4_cannode",
|
2019-02-05 20:53:54 -04:00
|
|
|
"px4_fmu-v4_default",
|
|
|
|
"px4_fmu-v4pro_default",
|
2021-01-10 23:02:24 -04:00
|
|
|
"px4_fmu-v5_ctrlalloc",
|
2020-07-05 15:27:21 -03:00
|
|
|
"px4_fmu-v5_debug",
|
2021-01-10 23:02:24 -04:00
|
|
|
"px4_fmu-v5_default",
|
2020-02-16 13:11:54 -04:00
|
|
|
"px4_fmu-v5_fixedwing",
|
|
|
|
"px4_fmu-v5_multicopter",
|
2020-03-22 18:50:17 -03:00
|
|
|
"px4_fmu-v5_optimized",
|
2020-02-16 13:11:54 -04:00
|
|
|
"px4_fmu-v5_rover",
|
|
|
|
"px4_fmu-v5_rtps",
|
|
|
|
"px4_fmu-v5_stackcheck",
|
2021-02-18 12:01:16 -04:00
|
|
|
"px4_fmu-v5_uavcanv0periph",
|
|
|
|
"px4_fmu-v5_uavcanv1",
|
2020-06-08 17:52:13 -03:00
|
|
|
"px4_fmu-v5x_base_phy_DP83848C",
|
2020-06-20 15:18:00 -03:00
|
|
|
"px4_fmu-v5x_default",
|
2021-02-02 11:50:26 -04:00
|
|
|
"px4_fmu-v6u_default",
|
2021-02-18 12:01:16 -04:00
|
|
|
"px4_fmu-v6x_default",
|
2020-01-22 15:58:57 -04:00
|
|
|
"px4_io-v2_default",
|
2020-08-03 16:36:03 -03:00
|
|
|
"spracing_h7extreme_default",
|
2020-01-22 16:02:55 -04:00
|
|
|
"uvify_core_default"
|
|
|
|
],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.nuttx,
|
|
|
|
archive: true
|
|
|
|
]
|
|
|
|
|
|
|
|
def snapdragon_builds = [
|
2020-01-09 19:09:06 -04:00
|
|
|
target: ["atlflight_eagle_qurt", "atlflight_eagle_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.snapdragon,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
def docker_builds = [
|
2020-01-21 22:49:10 -04:00
|
|
|
armhf_builds, base_builds, nuttx_builds_archive//, 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
|
2019-03-09 00:17:06 -04:00
|
|
|
// stage('S3 Upload') {
|
|
|
|
// agent {
|
2021-05-02 13:33:51 -03:00
|
|
|
// docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
|
2019-03-09 00:17:06 -04:00
|
|
|
// }
|
|
|
|
// options {
|
|
|
|
// skipDefaultCheckout()
|
|
|
|
// }
|
|
|
|
// when {
|
|
|
|
// anyOf {
|
|
|
|
// branch 'master'
|
|
|
|
// branch 'beta'
|
|
|
|
// branch 'stable'
|
|
|
|
// branch 'pr-jenkins' // for testing
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// steps {
|
|
|
|
// sh 'echo "uploading to S3"'
|
|
|
|
// }
|
|
|
|
// }
|
2018-08-04 13:23:46 -03:00
|
|
|
|
|
|
|
} // stages
|
|
|
|
environment {
|
|
|
|
CCACHE_DIR = '/tmp/ccache'
|
|
|
|
CI = true
|
|
|
|
}
|
|
|
|
options {
|
2020-04-14 20:14:10 -03:00
|
|
|
buildDiscarder(logRotator(numToKeepStr: '5', 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 = ''
|
2020-04-02 07:23:40 -03:00
|
|
|
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2020-04-01') {
|
2019-01-29 10:48:24 -04:00
|
|
|
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')
|
2019-11-28 19:37:20 -04:00
|
|
|
sh('ccache -s')
|
2018-08-04 13:23:46 -03:00
|
|
|
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')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|