如何使用p4插件或p4触发Jenkins作业? [英] How to trigger a Jenkins job using the p4 plugin or p4?

查看:688
本文介绍了如何使用p4插件或p4触发Jenkins作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Jenkins作业中安装了 p4插件.这样可以使工作区适应最新的更改,然后进行构建.现在,在构建触发器"下,我选择了定期构建",并将作业设置为每10分钟运行一次.当有新的提交提交到P4时,有什么方法可以触发Jenkins的工作吗?我是使用插件还是使用"p4触发器"执行某些操作?如果是这样,我该怎么办?

I've installed this p4 plugin in a Jenkins job. This scynces a workspace to the latest change and then builds. Now, under "Build Triggers", I've chosen "Build periodically" and set the job to run every 10 mins. Is there a way do trigger this Jenkins job when a new submit comes in to P4? Do I use the plugin or do I do something with "p4 trigger"? If so, how can I do this?

谢谢!

推荐答案

在同一Build Triggers部分下,有一个名为Poll SCM的选项.启用该选项.安装Jenkins时,默认情况下会显示此选项.它完全符合您的要求.一旦检测到P4中的新提交,它将立即触发构建.虽然不是必需的,但也启用Quiet period是很好的.此选项在Advanced Project Options部分下(请参阅下面的快照).另请阅读每个选项随附的帮助(?),以更好地了解其功能.

Under the same Build Triggers section, there is an option named Poll SCM. Enable that option. This option is present by default when you install Jenkins. It does exactly what you're looking for. It will trigger build as soon as it detects a new commit in P4. Although not necessary, it's good to enable Quiet period too. This option is under Advanced Project Options section (refer snapshot below). Also read Help (?) that's provided with every option to gain better understanding of what it does.

这篇关于如何使用p4插件或p4触发Jenkins作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆