本文介绍了Jenkins CI:如何在SVN提交上触发构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置什么插件和插件功能,以便让我的Jenkins作业触发构建任何时间的代码被提交到一个SVN项目?我已经安装了标准SVN插件以及SVN标记插件,但没有看到任何允许触发器配置的新功能。

What plugins and plugin features do I need to set in order to get my Jenkins job to trigger a build anytime code is committed to a SVN project? I have installed both the standard SVN plugin as well as the SVN tagging plugin but do not see any new features that allow trigger configuration.

推荐答案

p>有两种方法可以做到这一点:

There are two ways to go about this:

我最初推荐第一个选项,因为它很容易实现。一旦您在构建过程中成熟,请切换到第二个。

I recommend the first option initially, due to its ease of implementation. Once you mature in your build processes, switch over to the second.


  1. 轮询存储库以查看是否发生更改。如果在同一轮询间隔内有两个提交,这可能会跳过提交。 ,请注意您配置的第四个屏幕截图

  1. Poll the repository to see if changes occurred. This might "skip" a commit if two commits come in within the same polling interval. Description of how to do so here, note the fourth screenshot where you configure on the job a "build trigger" based on polling the repository (with a crontab-like configuration).

将存储库配置为具有后提交钩子(post-commit hook)它通知Jenkins一个构建需要启动。 ,后提交钩子部分

Configure your repository to have a post-commit hook which notifies Jenkins that a build needs to start. Description of how to do so here, in the section "post-commit hooks"

SVN标签功能不是轮询的一部分,它是将源代码的当前头部一个标签,用于快照构建。这允许你引用Jenkins buid#32作为SVN标签/标签/ build-32(或类似的东西)。

The SVN Tag feature is not part of the polling, it is part of promoting the current "head" of the source code to a tag, to snapshot a build. This allows you to refer to Jenkins buid #32 as SVN tag /tags/build-32 (or something similar).

这篇关于Jenkins CI:如何在SVN提交上触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:26