Try-catch block in Jenkins pipeline script

后端 未结 5 1686
有刺的猬
有刺的猬 2020-12-13 18:16

I\'m trying to use the following code to execute builds, and in the end, execute post build actions when builds were successful. Still, I get a MultipleCompilationErrorsExce

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 19:00

    You're using the declarative style of specifying your pipeline, so you must not use try/catch blocks (which are for Scripted Pipelines), but the post section. See: https://jenkins.io/doc/book/pipeline/syntax/#post-conditions

提交回复
热议问题