diff --git a/Jenkinsfile b/Jenkinsfile index 4d7730666f93b203ad6dd6678cf58be45fe9343f..cd26b58b8cc4f4613745b3d656c2249efbb26377 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,11 @@ pipeline { sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`nproc --all`' sh 'ccache -s' - sh 'git clean -ff -x -d .' + } + post { + cleanup { + sh 'git clean -ff -x -d .' + } } } @@ -51,7 +55,11 @@ pipeline { sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`nproc --all`' sh 'ccache -s' - sh 'git clean -ff -x -d .' + } + post { + cleanup { + sh 'git clean -ff -x -d .' + } } } @@ -76,7 +84,11 @@ pipeline { sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`nproc --all`' sh 'ccache -s' - sh 'git clean -ff -x -d .' + } + post { + cleanup { + sh 'git clean -ff -x -d .' + } } } @@ -100,7 +112,11 @@ pipeline { sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`sysctl -n hw.ncpu`' sh 'ccache -s' - sh 'git clean -ff -x -d .' + } + post { + cleanup { + sh 'git clean -ff -x -d .' + } } } @@ -124,8 +140,14 @@ pipeline { sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`sysctl -n hw.ncpu`' sh 'ccache -s' - archiveArtifacts(artifacts: 'build/**/*.dmg', fingerprint: true, onlyIfSuccessful: true) - sh 'git clean -ff -x -d .' + } + post { + success { + archiveArtifacts(artifacts: 'build/**/*.dmg', fingerprint: true) + } + cleanup { + sh 'git clean -ff -x -d .' + } } } } // parallel