Jenkins CI:如何在 SVN 提交上触发构建 [英] Jenkins CI: How to trigger builds on SVN commit

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

问题描述

我需要设置哪些插件和插件功能才能让我的 Jenkins 作业在代码提交到 SVN 项目时触发构建?

What plugins and plugin features do I need to set in order to get my Jenkins job to trigger a build any time code is committed to an SVN project?

我已经安装了标准 SVN 插件和 SVN 标记插件,但我没有看到任何允许触发器配置的新功能.

I have installed both the standard SVN plugin as well as the SVN tagging plugin, but I do not see any new features that allow trigger configuration.

推荐答案

有两种方法可以解决这个问题:

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. 轮询存储库以查看是否发生了更改.这可能会跳过"如果在同一轮询间隔内有两次提交,则提交一次.此处说明如何操作,请注意您在作业中配置的第四个屏幕截图构建触发器"基于轮询存储库(使用类似 crontab 的配置).

  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 挂钩,该挂钩通知 Jenkins 需要开始构建.插件说明,在post-commit hooks"部分

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

SVN Tag 功能不是轮询的一部分,而是宣传当前头部"的一部分.源代码到一个标签,以快照构建.这允许您将 Jenkins buid #32 称为 SVN 标签/tags/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 提交上触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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