jenkins - Jenkins 自由式中止命令或步骤
问题描述
有谁知道中止 Jenkins Freestyle 工作的命令或步骤?
我可以在 3 分钟后使用超时,但无论如何我都看不到像管道作业一样通过设置currentBuild.result = 'ABORTED
'.
我在 Windows 上运行 Jenkins,因此正在寻找 bat 命令或类似的解决方案。
解决方案
You can add "kill" to the end of the path of any running job's execution,
Ex: https://hostname/jenkins/job/DDNS/4902/kill
and it will take you to a page that says:
This URL requires POST
The URL you're trying to access requires that requests be sent using POST (like a form submission). The button below allows you to retry accessing this URL using POST. URL being accessed:
https://hostname/jenkins/job/DDNS/4902/kill
If you were sent here from an untrusted source, please proceed with caution.
There will be a button for "Retry Using POST" -- click that and it will automatically kill any running job, aborting at current stage.
Therefore, if you want to make a script, use that URL with some logic to land on the right job number, with a POST method, and it should do what you want.
推荐阅读
- python - 有没有一种好的、可控的方法来比较两个 .json 文件并将它们的差异生成到 Python 中的 Excel 工作表中
- rust - 如何在编译时计算板条箱中注释为 #[test] 的函数数量?
- vhdl - 在减法器的 VHDL 实现中出现溢出错误
- firebase - 如何在 Flutter Firestore 中使用“where”过滤 CollectionGroup 查询
- java - 如何处理 Mono.fromCompletionStage 的异常
- java - 有没有办法让spring boot mongodb不会将你的id属性值更改为他的object_id?
- git - 如何告诉 Composer 将 .git 文件夹保留在存储库中
- php - 获取产品颜色变量名称和 id
- javascript - 未捕获的 ReferenceError:getweather 未在 HTMLButtonElement.onclick (index.html:31) 中定义
- javascript - 用变量改变页面的背景