Jenkins脚本管道仅在Github中发生提交时触发作业

问题描述 投票:0回答:2

我们使用CloudBees-2.138.2.2 Jenkins,并且在我们的Github repo中基于提交触发jenkins作业时遇到了很多挑战。我仍在寻找脚本管道的确切工作脚本,而不是声明性管道。

所以例如: - pipelineTriggers([cron('0-59 / 2 * * * *')]),但管道触发器([pollSCM('0-59 / 2 * * * *')])仍然无效新的提交

jenkins jenkins-pipeline cloudbees jenkins-groovy crontrigger
2个回答
0
投票

能够让它工作使用: -

pipelineTriggers([pollSCM('* * * * *')])在属性下

这样,作业每分钟轮询一次repo,并且只有在检测到新的提交时才会触发构建。


0
投票

您可以尝试在脚本管道中添加以下内容

properties([pipelineTriggers([githubPush()])])
© www.soinside.com 2019 - 2024. All rights reserved.