在Jenkins/Hudson中一次提交一次执行一次构建 [英] Enforcing one build for one commit in Jenkins/Hudson

查看:100
本文介绍了在Jenkins/Hudson中一次提交一次执行一次构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Jenkins在对SCM的每次提交中对项目进行增量构建.我们希望为每个提交获取单独的构建.但是,在以下情况下,幼稚的方法(设置SCM并使用提交后的钩子触发构建)会出现问题:

We use Jenkins for doing incremental builds of our project on each commit to the SCM. We would like to get separate builds for every single commit. However, the naive approach (setup SCM and use post-commit hooks to trigger a build) exhibits problem in the following scenario:

  • 构建已触发.
  • 构建时(可能要花几分钟时间),两次是由两个开发人员对SCM进行的单独提交.
  • 一个新版本已触发.它从上一次构建期间所做的两次提交中接收更改.
  • Build is triggered.
  • While build takes place (it can take up to several minutes) two separate commits to the SCM are made by two developers.
  • One new build is triggered. It receives changes from both of the commits, made during previous build.

此竞赛条件"使查找哪个提交破坏了构建/引入的警告变得复杂.

This "race condition" complicates finding which one of the commits has broken the build/introduced warnings.

当前采用的解决方案是检查一项作业(计划任务")中的更改,并触发另一项作业以进行实际的检出和构建.

The currently employed solution is checking for changes in one job ("scheduler job") and triggering another job to do the actual checkout and build.

有没有适当的解决方案来解决这个问题?

Are there any proper solutions to this problem?

推荐答案

尚未,有一个功能请求涵盖这种构建,但仍处于打开状态:

Not yet, there's a Feature Request covering this kind of build, but it's still open: Issue 673

这篇关于在Jenkins/Hudson中一次提交一次执行一次构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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