Jenkins: always fully clean git workspace

This commit is contained in:
Daniel Agar 2021-12-29 11:50:07 -05:00
parent 6d0339ba0c
commit 6706d9b434
3 changed files with 24 additions and 24 deletions

View File

@ -170,7 +170,7 @@ def createBuildNode(Boolean archive, String docker_image, String target) {
try { try {
sh('export') sh('export')
checkout(scm) checkout(scm)
sh('make distclean') sh('make distclean; git clean -ff -x -d .')
sh('git fetch --tags') sh('git fetch --tags')
sh('ccache -s') sh('ccache -s')
sh('make ' + target) sh('make ' + target)
@ -187,7 +187,7 @@ def createBuildNode(Boolean archive, String docker_image, String target) {
throw (exc) throw (exc)
} }
finally { finally {
sh('make distclean') sh('make distclean; git clean -ff -x -d .')
} }
} }
} }

View File

@ -25,7 +25,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -99,7 +99,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -168,7 +168,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -237,7 +237,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -305,7 +305,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -374,7 +374,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -463,7 +463,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -544,7 +544,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -613,7 +613,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} // stage build } // stage build
@ -683,7 +683,7 @@ void checkoutSCM() {
retry(3) { retry(3) {
checkout scm checkout scm
sh 'export' sh 'export'
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
sh 'git fetch --tags' sh 'git fetch --tags'
sh 'ccache -z' sh 'ccache -z'
} }

24
Jenkinsfile vendored
View File

@ -88,7 +88,7 @@ pipeline {
docker { image 'px4io/px4-dev-base-focal:2021-08-18' } docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
} }
steps { steps {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
sh 'git fetch --all --tags' sh 'git fetch --all --tags'
sh 'make airframe_metadata' sh 'make airframe_metadata'
dir('build/px4_sitl_default/docs') { dir('build/px4_sitl_default/docs') {
@ -98,7 +98,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} }
@ -108,7 +108,7 @@ pipeline {
docker { image 'px4io/px4-dev-base-focal:2021-08-18' } docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
} }
steps { steps {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
sh 'git fetch --all --tags' sh 'git fetch --all --tags'
sh 'make parameters_metadata' sh 'make parameters_metadata'
dir('build/px4_sitl_default/docs') { dir('build/px4_sitl_default/docs') {
@ -118,7 +118,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} }
@ -128,7 +128,7 @@ pipeline {
docker { image 'px4io/px4-dev-base-focal:2021-08-18' } docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
} }
steps { steps {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
sh 'git fetch --all --tags' sh 'git fetch --all --tags'
sh 'make module_documentation' sh 'make module_documentation'
dir('build/px4_sitl_default/docs') { dir('build/px4_sitl_default/docs') {
@ -138,7 +138,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} }
@ -156,7 +156,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} }
@ -170,7 +170,7 @@ pipeline {
} }
steps { steps {
sh 'export' sh 'export'
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
sh 'git fetch --all --tags' sh 'git fetch --all --tags'
sh 'make uorb_graphs' sh 'make uorb_graphs'
dir('Tools/uorb_graph') { dir('Tools/uorb_graph') {
@ -180,7 +180,7 @@ pipeline {
} }
post { post {
always { always {
sh 'make distclean' sh 'make distclean; git clean -ff -x -d .'
} }
} }
} }
@ -261,7 +261,7 @@ pipeline {
steps { steps {
sh('export') sh('export')
sh('git fetch --all --tags') sh('git fetch --all --tags')
sh('make distclean') sh('make distclean; git clean -ff -x -d .')
sh('make px4_sitl_rtps') sh('make px4_sitl_rtps')
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/micrortps_agent.git -b ${BRANCH_NAME}") sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/micrortps_agent.git -b ${BRANCH_NAME}")
@ -290,7 +290,7 @@ pipeline {
} }
steps { steps {
sh('export') sh('export')
sh('make distclean') sh('make distclean; git clean -ff -x -d .')
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_msgs.git") sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_msgs.git")
// 'master' branch // 'master' branch
@ -319,7 +319,7 @@ pipeline {
} }
steps { steps {
sh('export') sh('export')
sh('make distclean') sh('make distclean; git clean -ff -x -d .')
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_ros_com.git -b ${BRANCH_NAME}") sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_ros_com.git -b ${BRANCH_NAME}")
// deploy uORB RTPS ID map // deploy uORB RTPS ID map