jenkins - 将构建后的 shell 脚本添加到 Groovy 作业执行器
问题描述
我有一个看起来像这样的脚本:
cronjobs.groovy:
job('MYJOB') {
triggers {
cron('H * ** *')
}
steps {
shell('some shell script')
shell('some othre shell')
}
}
我想在 MYJOB 执行失败时添加另一个 shell 以在此处运行。是否可以?还是我必须实施管道?我可以以这种方式实现吗?我需要任何插件吗?
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')
}
}
解决方案
推荐阅读
- ios - 如何在 Xcode 10 中创建应用内购买包
- excel - 用于生成 pdf 的 VBA 宏(PC 和 Mac)
- firebase - 如何使用 Firebase + Unity 跟踪会话长度
- html - 我对css、像素显示的三个疑惑
- python - 如何在 python 3.7 中使用子进程读取 Windows 命令“查询用户”响应
- r - mutate 可以使用哪些类型的函数?
- c# - 我如何使用数据类型 IPHostEntry,包括嵌套 try-catch 之间的 while-loop?
- python - 通过迭代行来创建新的循环因变量
- python - 在 TensorFlow Probability 中,与贝叶斯层的损失属性相关的损失是什么?
- javascript - THREE.js 从 3D 矢量转换为 2D 像素位置,解释 z 坐标