From 0746b628feaaab5d1b698224fd1ffc472eb751a6 Mon Sep 17 00:00:00 2001 From: Anthony Lamping Date: Wed, 30 May 2018 20:13:24 -0400 Subject: [PATCH] jenkins: use post for after build actions --- Jenkinsfile | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d7730666..cd26b58b8 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 -- 2.22.0