Jenkins可以在任何svn用户每次提交代码时都检测到吗? [英] can Jenkins detect everytime any svn-user commit the code?

查看:133
本文介绍了Jenkins可以在任何svn用户每次提交代码时都检测到吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jenkins可以在任何svn用户每次提交代码时检测到吗? 我想知道Jenkins每次提交svn-user时,是否有任何方法或jenkins插件? 现在我在Jenkins中使用svn update cmd来更新svn.

can Jenkins detect everytime any svn-user commit the code? I want to know everytime the svn-user commit by Jenkins, is there any way or jenkins plugin? now I use svn update cmd in Jenkins to update svn.

推荐答案

您可以按照以下两种方法之一来获取所需的内容

You can follow either of following approaches to get what you want

  1. 轮询SVN以获取来自詹金斯的更改
  2. 配置SVN(使用后提交钩子)以触发Jenkins上的构建

要进行轮询,请转到作业属性-> 构建触发器"并选择轮询SCM时间表".您可以指定希望SVN多久轮询一次存储库.您可以将此值保持在1分钟之内.

For polling, go to job properties -> "Build Triggers" heading and select "Poll SCM Schedule". You can specify how often do you want SVN to poll the repository. You can keep this value as low as 1 minute.

有关SVN发布后提交钩子,请查看 Subversion插件文档.这在图3的提交后挂钩"中详细解释.部分.请仔细阅读本节,因为它解释了所有选项,包括在什么情况下/何时在触发脚本的jenkins REST调用中包括哪些svn信息.

For SVN post commit hook, take a look at Subversion Plugin Documentation. This is explained in detail in "Post-commit hook" section. Please read through this section carefully as it explains all the options including what/when to include which svn information in jenkins REST call from the trigger script.

如果您的构建依赖于多个存储库(例如,每个解决方案都在其自身的存储库中),那么SVN提交是最佳选择,因为您可以通过提供/来触发所有存储库提交后的单个作业在后提交挂钩脚本中调整参数.

If you build is dependent on multiple repositories (say every solution is in repository of it's own) then SVN post commit is the best option since you'll be able to trigger a single job from all the repository post commit by providing/tweaking parameters in the post commit hook script.

从侧面讲,我可以理解为什么有人拒绝了您的问题.我强烈建议您在问题中添加完整的信息,并表明您在发表问题之前已经进行了研究.有关"jenkins触发基于svn commit的构建"的快速Google信息,导致我首先想到这个stackoverflow问题准确地解释了您要做什么.这个问题(及其答案)非常古老(要求追溯到8年前,一直活跃到去年),但是有关该问题的每一点信息仍然非常有用. " 如何问一个好问题" stackoverflow帮助部分中的内容进一步解释了stackoverflow社区在每个问题中的总体期望.

On a side note, I can understand why someone downvoted your question. I'll strongly recommend you to add full information in your questions and show that you have done the research yourself before posting a question. A quick google on "jenkins trigger build on svn commit" lead me to this stackoverflow question as the first result which precisely explains what you are trying to do. The question (and it's answers) are very old (asked 8 years back, active till last year) but every bit of information is still very helpful for this question. "How do I ask a good question" from stackoverflow help section further explains what does stackoverflow community expects in general in every question.

这篇关于Jenkins可以在任何svn用户每次提交代码时都检测到吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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