px4-firmware/Jenkinsfile

655 lines
23 KiB
Plaintext
Raw Normal View History

2017-10-27 11:47:38 -03:00
pipeline {
agent none
2017-10-27 11:47:38 -03:00
stages {
2018-03-30 11:05:13 -03:00
stage('Style Check') {
agent {
2018-03-30 15:01:29 -03:00
docker { image 'px4io/px4-dev-base:2018-03-30' }
2018-03-30 11:05:13 -03:00
}
steps {
sh 'make check_format'
}
}
stage('Build') {
steps {
script {
def builds = [:]
def docker_base = "px4io/px4-dev-base:2018-03-30"
def docker_nuttx = "px4io/px4-dev-nuttx:2018-03-30"
def docker_ros = "px4io/px4-dev-ros:2018-03-30"
def docker_rpi = "px4io/px4-dev-raspi:2018-03-30"
def docker_armhf = "px4io/px4-dev-armhf:2017-12-30"
def docker_arch = "px4io/px4-dev-base-archlinux:2018-03-30"
def docker_snapdragon = "lorenzmeier/px4-dev-snapdragon:2017-12-29"
def docker_clang = "px4io/px4-dev-clang:2018-03-30"
// fmu-v2_{default, lpe} and fmu-v3_{default, rtps}
// bloaty compare to last successful master build
builds["px4fmu-v2"] = {
node {
stage("Build Test px4fmu-v2") {
docker.image(docker_nuttx).inside('-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
stage("px4fmu-v2") {
checkout scm
sh "export"
sh "make distclean"
sh "ccache -z"
sh "git fetch --tags"
sh "make px4io-v2_default"
sh "make nuttx_px4fmu-v2_default"
// bloaty output and compare with last successful master
sh "bloaty -d symbols -n 100 -s vm build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf"
sh "bloaty -d compileunits -n 100 -s vm build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf"
sh "wget --no-verbose -N https://s3.amazonaws.com/px4-travis/Firmware/master/nuttx_px4fmu-v2_default.elf"
sh "bloaty -d symbols -n 100 -C full -s file build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf -- nuttx_px4fmu-v2_default.elf"
sh "make nuttx_px4fmu-v2_lpe"
sh "make nuttx_px4fmu-v2_test"
sh "make nuttx_px4fmu-v3_default"
sh "bloaty -d symbols -n 100 -s vm build/nuttx_px4fmu-v3_default/nuttx_px4fmu-v3_default.elf"
sh "bloaty -d compileunits -n 100 -s vm build/nuttx_px4fmu-v3_default/nuttx_px4fmu-v3_default.elf"
sh "wget --no-verbose -N https://s3.amazonaws.com/px4-travis/Firmware/master/nuttx_px4fmu-v3_default.elf"
sh "bloaty -d symbols -n 100 -C full -s vm build/nuttx_px4fmu-v3_default/nuttx_px4fmu-v3_default.elf -- nuttx_px4fmu-v3_default.elf"
sh "make nuttx_px4fmu-v3_rtps"
sh "make sizes"
sh "ccache -s"
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/**/*.px4, build/**/*.elf', fingerprint: true, onlyIfSuccessful: true)
sh "make distclean"
}
}
}
}
}
// nuttx default targets that are archived and uploaded to s3
for (def option in ["px4fmu-v4", "px4fmu-v4pro", "px4fmu-v5", "aerofc-v1", "aerocore2", "auav-x21", "crazyflie", "mindpx-v2", "nxphlite-v3", "tap-v1"]) {
def node_name = "${option}"
builds[node_name] = createBuildNode(docker_nuttx, "${node_name}_default")
}
// other nuttx default targets
for (def option in ["px4-same70xplained-v1", "px4-stm32f4discovery", "px4cannode-v1", "px4esc-v1", "px4nucleoF767ZI-v1", "s2740vc-v1"]) {
def node_name = "${option}"
builds[node_name] = createBuildNode(docker_nuttx, "${node_name}_default")
}
builds["sitl"] = createBuildNode(docker_base, 'posix_sitl_default')
builds["sitl_rtps"] = createBuildNode(docker_base, 'posix_sitl_rtps')
builds["sitl (GCC 7)"] = createBuildNode(docker_arch, 'posix_sitl_default')
builds["rpi"] = createBuildNode(docker_rpi, 'posix_rpi_cross')
builds["bebop"] = createBuildNode(docker_rpi, 'posix_bebop_default')
builds["ocpoc"] = createBuildNode(docker_armhf, 'posix_ocpoc_ubuntu')
// snapdragon (eagle_default)
builds["eagle (linux)"] = createBuildNodeDockerLogin(docker_snapdragon, 'docker_hub_dagar', 'posix_eagle_default')
builds["eagle (qurt)"] = createBuildNodeDockerLogin(docker_snapdragon, 'docker_hub_dagar', 'qurt_eagle_default')
// MAC OS posix_sitl_default
builds["sitl (OSX)"] = {
2018-04-14 00:35:06 -03:00
node("mac") {
withEnv(["CCACHE_BASEDIR=${pwd()}"]) {
stage("sitl (OSX)") {
checkout scm
sh "export"
sh "make distclean"
sh "ccache -z"
sh "make posix_sitl_default"
sh "ccache -s"
sh "make distclean"
}
}
}
}
// MAC OS nuttx_px4fmu-v4pro_default
builds["px4fmu-v4pro (OSX)"] = {
2018-04-14 00:35:06 -03:00
node("mac") {
withEnv(["CCACHE_BASEDIR=${pwd()}"]) {
stage("px4fmu-v4pro (OSX)") {
checkout scm
sh "export"
sh "make distclean"
sh "ccache -z"
sh "make nuttx_px4fmu-v4pro_default"
sh "ccache -s"
sh "make distclean"
}
}
}
}
parallel builds
} // script
} // steps
} // stage Builds
stage('Test') {
parallel {
stage('clang analyzer') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-clang:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make scan-build'
// publish html
publishHTML target: [
reportTitles: 'clang static analyzer',
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'build/scan-build/report_latest',
reportFiles: '*',
reportName: 'Clang Static Analyzer'
]
sh 'make distclean'
}
when {
anyOf {
branch 'master'
branch 'beta'
branch 'stable'
}
}
}
2017-12-15 10:46:38 -04:00
stage('clang tidy') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-clang:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
2017-12-15 10:46:38 -04:00
}
}
steps {
sh 'export'
sh 'make distclean'
2017-12-15 10:46:38 -04:00
sh 'make clang-tidy-quiet'
sh 'make distclean'
2017-12-15 10:46:38 -04:00
}
}
2017-12-15 11:34:24 -04:00
stage('cppcheck') {
agent {
docker {
image 'px4io/px4-dev-base:ubuntu17.10'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
2017-12-15 11:34:24 -04:00
}
}
steps {
sh 'export'
sh 'make distclean'
2017-12-15 11:34:24 -04:00
sh 'make cppcheck'
// publish html
publishHTML target: [
reportTitles: 'Cppcheck',
2017-12-15 11:34:24 -04:00
allowMissing: false,
alwaysLinkToLastBuild: true,
2017-12-15 11:34:24 -04:00
keepAll: true,
reportDir: 'build/cppcheck/',
2017-12-15 11:34:24 -04:00
reportFiles: '*',
reportName: 'Cppcheck'
2017-12-15 11:34:24 -04:00
]
sh 'make distclean'
2017-12-15 11:34:24 -04:00
}
when {
anyOf {
branch 'master'
branch 'beta'
branch 'stable'
}
}
2017-12-15 11:34:24 -04:00
}
stage('tests') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-base:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
2017-11-28 18:32:55 -04:00
sh 'make posix_sitl_default test_results_junit'
junit 'build/posix_sitl_default/JUnitTestResults.xml'
sh 'make distclean'
}
}
stage('check stack') {
agent {
docker {
image 'px4io/px4-dev-nuttx:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make px4fmu-v2_default stack_check'
sh 'make distclean'
}
}
stage('ROS vtol standard mission') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
2018-03-01 12:56:21 -04:00
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=standard_vtol'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
2018-04-14 00:26:31 -03:00
}
}
}
stage('ROS vtol tailsitter mission') {
agent {
docker {
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=tailsitter'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
stage('ROS vtol tiltrotor mission') {
agent {
docker {
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=tiltrotor'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
2017-12-31 23:57:45 -04:00
stage('ROS vtol mission new 2') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
2018-03-01 12:56:21 -04:00
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_2 vehicle:=standard_vtol'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
2017-12-31 23:57:45 -04:00
stage('ROS vtol mission old 1') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
2018-03-01 12:56:21 -04:00
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_old_1 vehicle:=standard_vtol'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
2017-12-31 23:57:45 -04:00
stage('ROS vtol mission old 2') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
2018-03-01 12:56:21 -04:00
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_old_2 vehicle:=standard_vtol'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
2017-12-31 23:57:45 -04:00
stage('ROS MC mission box') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
2018-03-01 12:56:21 -04:00
sh './test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=multirotor_box vehicle:=iris'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
stage('ROS offboard att') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
sh './test/rostest_px4_run.sh mavros_posix_tests_offboard_attctl.test'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
stage('ROS offboard pos') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-ros:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'git fetch --tags'
sh 'make posix_sitl_default'
sh 'make posix_sitl_default sitl_gazebo'
sh './test/rostest_px4_run.sh mavros_posix_tests_offboard_posctl.test'
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
}
post {
always {
sh './Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
archiveArtifacts '.ros/**/*.pdf'
archiveArtifacts '.ros/**/*.csv'
sh 'make distclean'
}
failure {
2018-03-01 12:56:21 -04:00
archiveArtifacts '.ros/**/*.ulg'
archiveArtifacts '.ros/**/rosunit-*.xml'
archiveArtifacts '.ros/**/rostest-*.log'
}
}
}
}
}
stage('Generate Metadata') {
parallel {
stage('airframe') {
agent {
2018-03-30 15:01:29 -03:00
docker { image 'px4io/px4-dev-base:2018-03-30' }
}
steps {
2018-02-02 01:09:29 -04:00
sh 'make distclean'
sh 'make airframe_metadata'
archiveArtifacts(artifacts: 'airframes.md, airframes.xml', fingerprint: true)
sh 'make distclean'
}
}
stage('parameter') {
agent {
2018-03-30 15:01:29 -03:00
docker { image 'px4io/px4-dev-base:2018-03-30' }
}
steps {
2018-02-02 01:09:29 -04:00
sh 'make distclean'
sh 'make parameters_metadata'
archiveArtifacts(artifacts: 'parameters.md, parameters.xml', fingerprint: true)
sh 'make distclean'
}
}
stage('module') {
agent {
2018-03-30 15:01:29 -03:00
docker { image 'px4io/px4-dev-base:2018-03-30' }
}
steps {
2018-02-02 01:09:29 -04:00
sh 'make distclean'
sh 'make module_documentation'
archiveArtifacts(artifacts: 'modules/*.md', fingerprint: true)
sh 'make distclean'
}
}
2018-01-05 18:20:39 -04:00
stage('uorb graphs') {
agent {
docker {
2018-03-30 15:01:29 -03:00
image 'px4io/px4-dev-nuttx:2018-03-30'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
2018-01-05 18:20:39 -04:00
}
steps {
sh 'export'
2018-02-02 01:09:29 -04:00
sh 'make distclean'
2018-01-05 18:20:39 -04:00
sh 'make uorb_graphs'
archiveArtifacts(artifacts: 'Tools/uorb_graph/graph_sitl.json')
sh 'make distclean'
2018-01-05 18:20:39 -04:00
}
}
}
}
stage('S3 Upload') {
agent {
2018-03-30 15:01:29 -03:00
docker { image 'px4io/px4-dev-base:2018-03-30' }
}
when {
anyOf {
branch 'master'
branch 'beta'
branch 'stable'
}
}
steps {
sh 'echo "uploading to S3"'
2017-10-27 11:47:38 -03:00
}
}
} // stages
environment {
CCACHE_DIR = '/tmp/ccache'
CI = true
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
timeout(time: 60, unit: 'MINUTES')
2017-10-27 11:47:38 -03:00
}
2017-11-05 16:04:14 -04:00
}
def createBuildNode(String docker_repo, String target) {
return {
node {
docker.image(docker_repo).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
stage(target) {
sh('export')
checkout scm
sh('make distclean')
sh('git fetch --tags')
sh('ccache -z')
sh('make ' + target)
sh('ccache -s')
sh('make sizes')
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/**/*.px4, build/**/*.elf', fingerprint: true, onlyIfSuccessful: true)
sh('make distclean')
}
}
}
}
}
def createBuildNodeDockerLogin(String docker_repo, String docker_credentials, String target) {
return {
node {
docker.withRegistry('https://registry.hub.docker.com', docker_credentials) {
docker.image(docker_repo).inside('-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
stage(target) {
sh('export')
checkout scm
sh('make distclean')
sh('git fetch --tags')
sh('ccache -z')
sh('make ' + target)
sh('ccache -s')
sh('make sizes')
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/**/*.px4, build/**/*.elf', fingerprint: true, onlyIfSuccessful: true)
sh('make distclean')
}
}
}
}
}
}