Jenkins管道-SVN轮询 [英] Jenkins Pipeline - SVN polling

查看:142
本文介绍了Jenkins管道-SVN轮询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkins管道模板,该模板在Subversion中使用Jenkins文件.

I have a Jenkins pipeline template which uses a Jenkins file in Subversion.

Jenkins文件具有svn checkout方法来签出实际的应用程序. (实际应用程序的svn url是通过jenkins env变量传递的)

The Jenkins file has the svn checkout method to check out the real application. (The svn url of real application is passed from jenkins env variables)

我需要对真实应用程序进行svn轮询,并在真实应用程序发生更改时触发工作.

I need to do the svn polling of the real application and trigger the job when there is a change in real application.

当我在jenkins模板中使用轮询选项时,它总是在Subversion中执行JenkinsFile的轮询.

When I use the polling option in jenkins template , it always do the polling of JenkinsFile in Subversion.

有什么方法可以轮询真实的应用程序?

Is there any way that I can poll the real application?

推荐答案

我的问题是我每5个小时而不是5分钟配置一次crone语法(这很愚蠢).

The issue in my case was I have configured the crone syntax for every 5 hours instead of 5 mins (Its a stupid thing).

如果您正在使用管道作业,则管道DSL位于SCM远程计算机中.

If You are using a Pipeline job, where the Pipeline DSL is located in a SCM remote.

通常,您可以使用crone语法在作业中配置轮询,并可以从jenkins文件中调用checkout方法,它将对您的实际应用程序进行轮询. (这是詹金斯背后的魔力)

Normally you can configure the polling in the job using the crone syntax and can call the checkout method from your jenkins file.It will do the polling of your real application. (Its the magic behind jenkins)

在此配置中,脚本内部没有轮询(在此称为Jenkinsfile),但在作业配置中.因此,它的工作方式与其他任何作业一样:它检查使用cron表达式配置的SCM遥控器,当它检测到修改后,便从配置的遥控器中检出Pipeline脚本.

In this configuration, you don't have the polling inside the script (called Jenkinsfile here), but in the job configuration. So it works as in any other jobs: it checks the SCM remote as configured with the cron expression, when it detected a modification, it checkout the Pipeline script from the configured remote.

您可以按照下面的文档

https://support.cloudbees.com/hc/zh-CN/articles/205028534-How-do-I-configure-SCM-Polling-in-a-Pipeline-Template-

这篇关于Jenkins管道-SVN轮询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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