詹金斯等待事件发生
当事件发生时,让詹金斯对某些事情采取行动,同时它可以等待事件的最佳方式是什么?
我正在考虑编写一个 ant 脚本,它可以探测一个进程,在开始执行另一个任务之前查看它是否已经完成,但我不确定这样做是个好主意,也许只使用 shell 脚本?只是想知道您做类似事情的经验是什么。
What is the best way to allow jenkins to act on something when a event happens, meanwhile it can wait for the event?
I was thinking of writing an ant script that can prob a process that it started to see if it had completed yet before moving onto another task, but I'm not sure it's a good idea to do that, perhaps just use a shell script? Just wanted to know what is your experience with doing something like that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
詹金斯不应该等待。作业构建应该由“某事”事件触发。这可以通过像
http://jenkins.myserver.com:8080/job/myjob/buildWithParameters?delay=0sec&myparm=42
这样的 URL 上的 wget 来完成。您还可以使用 jenkins CLI。Jenkins should not wait. A job build should be triggered from the 'something' event. This can be acomplished by a wget on an URL like
http://jenkins.myserver.com:8080/job/myjob/buildWithParameters?delay=0sec&myparm=42
. You can also use the jenkins CLI.试试这个插件: https://plugins.jenkins.io/webhook-step/
根据文档:此管道插件提供了一种简单的方法来阻止构建管道,直到外部系统发布到 Webhook。它可用于将长时间运行的任务集成到管道中,而无需忙于等待。
try this plugin: https://plugins.jenkins.io/webhook-step/
As per the documentation: This pipeline plugin provides an easy way to block a build pipeline until an external system posts to a webhook. It can be used to integrate long running tasks into a pipeline, without busy waiting.