jenkins: cleanup post stage steps

This commit is contained in:
Anthony Lamping
2018-10-15 16:35:02 -04:00
committed by Daniel Agar
parent 906559d8cf
commit 27b2dad1fb

112
Jenkinsfile vendored
View File

@@ -5,14 +5,14 @@ pipeline {
stage('Analysis') { stage('Analysis') {
parallel { parallel {
stage('catkin') {
stage('Catkin') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-ros:2018-09-24' image 'px4io/px4-dev-ros:2018-09-24'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE' args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
} }
} }
steps { steps {
sh 'ls -l' sh 'ls -l'
sh '''#!/bin/bash -l sh '''#!/bin/bash -l
@@ -25,24 +25,32 @@ pipeline {
source devel/setup.bash; source devel/setup.bash;
catkin build -j$(nproc) -l$(nproc); catkin build -j$(nproc) -l$(nproc);
''' '''
sh 'rm -rf catkin_ws' }
post {
always {
sh 'rm -rf catkin_ws'
}
} }
options { options {
checkoutToSubdirectory('catkin_ws/src/Firmware') checkoutToSubdirectory('catkin_ws/src/Firmware')
} }
} }
stage('Style Check') { stage('Style check') {
agent { agent {
docker { image 'px4io/px4-dev-base:2018-09-11' } docker { image 'px4io/px4-dev-base:2018-09-11' }
} }
steps { steps {
sh 'make check_format' sh 'make check_format'
} }
post {
always {
sh 'rm -rf catkin_ws'
}
}
} }
stage('bloaty px4fmu-v2') { stage('Bloaty px4fmu-v2') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-nuttx:2018-09-11' image 'px4io/px4-dev-nuttx:2018-09-11'
@@ -62,11 +70,15 @@ pipeline {
sh 'make nuttx_px4fmu-v2_default bloaty_compare_master' sh 'make nuttx_px4fmu-v2_default bloaty_compare_master'
sh 'make sizes' sh 'make sizes'
sh 'ccache -s' sh 'ccache -s'
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('bloaty px4fmu-v5') { stage('Bloaty px4fmu-v5') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-nuttx:2018-09-11' image 'px4io/px4-dev-nuttx:2018-09-11'
@@ -86,11 +98,15 @@ pipeline {
sh 'make nuttx_px4fmu-v5_default bloaty_compare_master' sh 'make nuttx_px4fmu-v5_default bloaty_compare_master'
sh 'make sizes' sh 'make sizes'
sh 'ccache -s' sh 'ccache -s'
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('clang analyzer') { stage('Clang analyzer') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-clang:2018-09-11' image 'px4io/px4-dev-clang:2018-09-11'
@@ -111,7 +127,11 @@ pipeline {
reportFiles: '*', reportFiles: '*',
reportName: 'Clang Static Analyzer' reportName: 'Clang Static Analyzer'
] ]
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
when { when {
anyOf { anyOf {
@@ -123,7 +143,7 @@ pipeline {
} }
} }
stage('clang tidy') { stage('Clang tidy') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-clang:2018-03-30' image 'px4io/px4-dev-clang:2018-03-30'
@@ -136,11 +156,15 @@ pipeline {
sh 'make distclean' sh 'make distclean'
sh 'make clang-tidy-quiet' sh 'make clang-tidy-quiet'
} }
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('cppcheck') { stage('Cppcheck') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-base:2018-09-11' image 'px4io/px4-dev-base:2018-09-11'
@@ -161,7 +185,11 @@ pipeline {
reportFiles: '*', reportFiles: '*',
reportName: 'Cppcheck' reportName: 'Cppcheck'
] ]
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
when { when {
anyOf { anyOf {
@@ -173,7 +201,7 @@ pipeline {
} }
} }
stage('check stack') { stage('Check stack') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-nuttx:2018-09-11' image 'px4io/px4-dev-nuttx:2018-09-11'
@@ -184,7 +212,11 @@ pipeline {
sh 'export' sh 'export'
sh 'make distclean' sh 'make distclean'
sh 'make px4fmu-v2_default stack_check' sh 'make px4fmu-v2_default stack_check'
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
@@ -199,11 +231,15 @@ pipeline {
sh 'export' sh 'export'
sh 'make distclean' sh 'make distclean'
sh 'make shellcheck_all' sh 'make shellcheck_all'
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('Module Config Validation') { stage('Module config validation') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-base:2018-09-11' image 'px4io/px4-dev-base:2018-09-11'
@@ -212,8 +248,14 @@ pipeline {
} }
steps { steps {
sh 'export' sh 'export'
sh 'make distclean'
sh 'make validate_module_configs' sh 'make validate_module_configs'
} }
post {
always {
sh 'make distclean'
}
}
} }
} // parallel } // parallel
@@ -223,7 +265,7 @@ pipeline {
parallel { parallel {
stage('airframe') { stage('Airframe') {
agent { agent {
docker { image 'px4io/px4-dev-base:2018-09-11' } docker { image 'px4io/px4-dev-base:2018-09-11' }
} }
@@ -234,11 +276,15 @@ pipeline {
archiveArtifacts(artifacts: 'airframes.md, airframes.xml') archiveArtifacts(artifacts: 'airframes.md, airframes.xml')
stash includes: 'airframes.md, airframes.xml', name: 'metadata_airframes' stash includes: 'airframes.md, airframes.xml', name: 'metadata_airframes'
} }
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('parameter') { stage('Parameter') {
agent { agent {
docker { image 'px4io/px4-dev-base:2018-09-11' } docker { image 'px4io/px4-dev-base:2018-09-11' }
} }
@@ -249,11 +295,15 @@ pipeline {
archiveArtifacts(artifacts: 'parameters.md, parameters.xml') archiveArtifacts(artifacts: 'parameters.md, parameters.xml')
stash includes: 'parameters.md, parameters.xml', name: 'metadata_parameters' stash includes: 'parameters.md, parameters.xml', name: 'metadata_parameters'
} }
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('module') { stage('Module') {
agent { agent {
docker { image 'px4io/px4-dev-base:2018-09-11' } docker { image 'px4io/px4-dev-base:2018-09-11' }
} }
@@ -264,11 +314,15 @@ pipeline {
archiveArtifacts(artifacts: 'modules/*.md') archiveArtifacts(artifacts: 'modules/*.md')
stash includes: 'modules/*.md', name: 'metadata_module_documentation' stash includes: 'modules/*.md', name: 'metadata_module_documentation'
} }
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }
stage('uorb graphs') { stage('uORB graphs') {
agent { agent {
docker { docker {
image 'px4io/px4-dev-nuttx:2018-09-11' image 'px4io/px4-dev-nuttx:2018-09-11'
@@ -283,7 +337,11 @@ pipeline {
archiveArtifacts(artifacts: 'graph_sitl.json') archiveArtifacts(artifacts: 'graph_sitl.json')
stash includes: 'graph_sitl.json', name: 'uorb_graph' stash includes: 'graph_sitl.json', name: 'uorb_graph'
} }
sh 'make distclean' }
post {
always {
sh 'make distclean'
}
} }
} }