我有一个看起来像这样的脚本:
cronjobs.groovy:
job('MYJOB') {
triggers {
cron('H * ** *')
}
steps {
shell('some shell script')
shell('some othre shell')
}
}我想添加另一个shell,在MYJOB执行失败时在这里运行。有可能吗?或者我必须实现一个管道?我可以用这种方式实现它吗?我需要任何插件来做这个吗?
job('MYJOB') {
triggers {
cron('H * ** *')
}
steps {
shell('some shell script')
shell('some other shell script')
}
post {
failure {
shell('some shell script')
shell('some more shell script')
}
}发布于 2021-07-21 22:48:46
根据作业dsl,作业具有使用发布者的构建后操作指令,但是您不能指定失败条件,也不能直接执行docs命令,尽管您可以调用groovy script。
所以更好的方法是使用管道
https://stackoverflow.com/questions/68471238
复制相似问题