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 = [
|
2018-11-25 11:29:42 -04:00
|
|
|
arch: "px4io/px4-dev-base-archlinux:2018-11-22",
|
2018-09-12 01:05:22 -03:00
|
|
|
armhf: "px4io/px4-dev-armhf:2018-09-11",
|
2018-11-25 11:29:42 -04:00
|
|
|
base: "px4io/px4-dev-base:2018-11-22",
|
2018-09-12 01:05:22 -03:00
|
|
|
nuttx: "px4io/px4-dev-nuttx:2018-09-11",
|
2018-11-25 11:29:42 -04:00
|
|
|
ros: "px4io/px4-dev-ros:2018-11-22",
|
2018-11-25 14:09:15 -04:00
|
|
|
rpi: "px4io/px4-dev-raspi:2018-11-22",
|
2018-09-12 10:53:11 -03:00
|
|
|
snapdragon: "lorenzmeier/px4-dev-snapdragon:2018-09-12"
|
2018-08-04 13:23:46 -03:00
|
|
|
]
|
|
|
|
|
2018-11-22 00:27:21 -04:00
|
|
|
// MAC OSX px4_sitl_default
|
|
|
|
build_nodes["px4_sitl_default (OSX)"] = {
|
2018-08-04 13:23:46 -03:00
|
|
|
node("mac") {
|
|
|
|
withEnv(["CCACHE_BASEDIR=${pwd()}"]) {
|
|
|
|
stage("sitl (OSX)") {
|
|
|
|
try {
|
|
|
|
checkout(scm)
|
|
|
|
sh('export')
|
|
|
|
sh('make distclean')
|
|
|
|
sh('ccache -z')
|
2018-11-22 00:27:21 -04:00
|
|
|
sh('make px4_sitl_default')
|
2018-08-04 13:23:46 -03:00
|
|
|
sh('ccache -s')
|
2018-11-15 14:54:51 -04:00
|
|
|
sh('make tests')
|
2018-08-04 13:23:46 -03:00
|
|
|
}
|
|
|
|
catch (exc) {
|
|
|
|
throw (exc)
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
sh('make distclean')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-22 00:27:21 -04:00
|
|
|
// MAC OSX px4_fmu-v4pro_default
|
|
|
|
build_nodes["px4_fmu-v4pro_default (OSX)"] = {
|
2018-08-04 13:23:46 -03:00
|
|
|
node("mac") {
|
|
|
|
withEnv(["CCACHE_BASEDIR=${pwd()}"]) {
|
2018-11-22 00:27:21 -04:00
|
|
|
stage("px4_fmu-v4pro (OSX)") {
|
2018-08-04 13:23:46 -03:00
|
|
|
try {
|
|
|
|
checkout(scm)
|
|
|
|
sh('export')
|
|
|
|
sh('make distclean')
|
|
|
|
sh('ccache -z')
|
2018-11-22 00:27:21 -04:00
|
|
|
sh('make px4_fmu-v4pro_default')
|
2018-08-04 13:23:46 -03:00
|
|
|
sh('ccache -s')
|
|
|
|
}
|
|
|
|
catch (exc) {
|
|
|
|
throw (exc)
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
sh('make distclean')
|
|
|
|
}
|
2018-08-22 21:37:52 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 13:23:46 -03:00
|
|
|
// docker builds:
|
|
|
|
def arch_builds = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["px4_sitl_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.arch,
|
|
|
|
archive: false
|
|
|
|
]
|
|
|
|
|
|
|
|
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 = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["px4_fmu-v2_default", "px4_fmu-v3_default", "px4_fmu-v4_default", "px4_fmu-v4pro_default", "px4_fmu-v5_default", "px4_fmu-v5_rtps", "px4_fmu-v5_stackcheck",
|
|
|
|
"intel_aerofc-v1_default", "gumstix_aerocore2_default", "auav_x21_default", "av_x-v1_default", "bitcraze_crazyflie_default", "airmind_mindpx-v2_default",
|
|
|
|
"nxp_hlite-v3_default", "omnibus_f4sd_default"],
|
2018-08-04 13:23:46 -03:00
|
|
|
image: docker_images.nuttx,
|
|
|
|
archive: true
|
|
|
|
]
|
|
|
|
|
|
|
|
def nuttx_builds_other = [
|
2018-11-22 00:27:21 -04:00
|
|
|
target: ["atmel_same70xplained_default", "stm_32f4discovery_default", "px4_cannode-v1_default",
|
|
|
|
"px4_esc-v1_default", "stm_nucleo-F767ZI_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 = [
|
2018-08-04 13:58:09 -03:00
|
|
|
arch_builds, 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 {
|
2018-11-25 11:29:42 -04:00
|
|
|
docker { image 'px4io/px4-dev-base:2018-11-22' }
|
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 {
|
|
|
|
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
|
|
|
|
timeout(time: 60, unit: 'MINUTES')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def createBuildNode(Boolean archive, String docker_image, String target) {
|
|
|
|
return {
|
|
|
|
node {
|
|
|
|
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
|
|
|
|
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
|
|
|
|
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) {
|
|
|
|
archiveArtifacts(allowEmptyArchive: false, artifacts: 'build/**/*.px4, build/**/*.elf, build/**/*.bin', fingerprint: true, onlyIfSuccessful: true)
|
|
|
|
}
|
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')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|