You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
4.2 KiB
138 lines
4.2 KiB
#!/usr/bin/env groovy |
|
|
|
pipeline { |
|
agent none |
|
stages { |
|
|
|
stage('Build') { |
|
steps { |
|
script { |
|
stage('sitl package') { |
|
node { |
|
docker.image("px4io/px4-dev-ros:2018-07-19").inside('-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE') { |
|
stage("sitl package") { |
|
try { |
|
checkout(scm) |
|
sh('export') |
|
sh('make distclean') |
|
sh "ccache -z" |
|
sh('make posix_sitl_default') |
|
sh "ccache -s" |
|
sh('make posix_sitl_default sitl_gazebo') |
|
sh "ccache -s" |
|
sh('make posix_sitl_default package') |
|
stash(name: "px4_sitl_package", includes: "build/posix_sitl_default/*.bz2") |
|
} |
|
catch (exc) { |
|
throw (exc) |
|
} |
|
finally { |
|
sh('make distclean') |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} // script |
|
} // steps |
|
} // Build |
|
|
|
stage('ROS Tests') { |
|
steps { |
|
script { |
|
def missions = [ |
|
[ |
|
name: "FW", |
|
test: "mavros_posix_test_mission.test", |
|
mission: "FW_mission_1", |
|
vehicle: "plane" |
|
], |
|
|
|
[ |
|
name: "MC box", |
|
test: "mavros_posix_test_mission.test", |
|
mission: "MC_mission_box", |
|
vehicle: "iris" |
|
], |
|
[ |
|
name: "MC offboard att", |
|
test: "mavros_posix_tests_offboard_attctl.test", |
|
mission: "", |
|
vehicle: "iris" |
|
], |
|
[ |
|
name: "MC offboard pos", |
|
test: "mavros_posix_tests_offboard_posctl.test", |
|
mission: "", |
|
vehicle: "iris" |
|
], |
|
|
|
[ |
|
name: "VTOL standard", |
|
test: "mavros_posix_test_mission.test", |
|
mission: "VTOL_mission_1", |
|
vehicle: "standard_vtol" |
|
], |
|
[ |
|
name: "VTOL tailsitter", |
|
test: "mavros_posix_test_mission.test", |
|
mission: "VTOL_mission_1", |
|
vehicle: "tailsitter" |
|
], |
|
[ |
|
name: "VTOL tiltrotor", |
|
test: "mavros_posix_test_mission.test", |
|
mission: "VTOL_mission_1", |
|
vehicle: "tiltrotor" |
|
], |
|
|
|
] |
|
|
|
def test_nodes = [:] |
|
for (def i = 0; i < missions.size(); i++) { |
|
test_nodes.put(missions[i].name, createTestNode(missions[i])) |
|
} |
|
|
|
parallel test_nodes |
|
} // script |
|
} // steps |
|
} // ROS Tests |
|
|
|
} //stages |
|
environment { |
|
CCACHE_DIR = '/tmp/ccache' |
|
CI = true |
|
} |
|
options { |
|
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30')) |
|
timeout(time: 60, unit: 'MINUTES') |
|
} |
|
} // pipeline |
|
|
|
def createTestNode(Map test_def) { |
|
return { |
|
node { |
|
cleanWs() |
|
docker.image("px4io/px4-dev-ros:2018-03-30").inside('-e HOME=${WORKSPACE}') { |
|
stage(test_def.name) { |
|
try { |
|
sh('export') |
|
unstash('px4_sitl_package') |
|
sh('tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2') |
|
sh('px4-posix_sitl_default*/px4/test/rostest_px4_run.sh ' + test_def.test + ' mission:=' + test_def.mission + ' vehicle:=' + test_def.vehicle) |
|
sh('px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/log/*/*.ulg') |
|
} |
|
catch (exc) { |
|
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.ulg, .ros/**/rosunit-*.xml, .ros/**/rostest-*.log') |
|
throw (exc) |
|
} |
|
finally { |
|
sh('px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/log/*/*.ulg') |
|
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.pdf, .ros/**/*.csv') |
|
} |
|
} |
|
} |
|
cleanWs() |
|
} |
|
} |
|
}
|
|
|