I used deleteDir () as follows:
post { always { deleteDir() } }
However, I also had to always run Success or Failed AFTER, but you cannot order the terms of publication. The current order is always changed, canceled, failure, success, and then unstable.
However, there is a very useful post cleaning state that always works, finally see https://jenkins.io/doc/book/pipeline/syntax/
So, in the end, my post was as follows:
post { always { } success{ } failure { } cleanup{ deleteDir() } }
Hope this can be useful for some corner cases.
user3586383 Aug 02 '18 at 15:08 2018-08-02 15:08
source share