【问题标题】:Configure hudson to build multiple branches配置 hudson 构建多个分支
【发布时间】:2009-12-03 10:21:08
【问题描述】:

我使用 ant 文件通过 hudson 在 mercurial 中构建一个 java 项目。 mailnine 的 hudson 工作运行良好。 最近创建了一个新分支并通过命令行推送到服务器:


hg 分支 newbranch
hg 提交
hg push -f


mainine 不包含这些更改,并且仍然可以正常构建。 我已经设置了一个与主线相同设置的新作业(实际上是在哈德逊复制了主线作业),并指定了新分支。

但是,newbranch 作业构建的代码与主线相同。 如果我命令行克隆存储库并切换到新分支,一切看起来都符合预期。这似乎是一个哈德逊配置故障,除非我的 merqurial 技能偏离了方向。

我还尝试使用与主线相同的设置从头开始设置作业,并添加了 newbranch 规范,但没有任何运气。

我错过了什么? 有人有什么想法吗?

【问题讨论】:

    标签: mercurial build hudson branch


    【解决方案1】:

    尝试将分支放在要克隆的 URL 中,如下所示:

    http://server/path/to/repo#newbranch
    

    ssh://user@server//path/to/repo#newbranch
    

    您可以使用hg help urls查看branch-in-repo-url 的完整语法

    URL Paths
    
    Valid URLs are of the form:
    
      local/filesystem/path[#revision]
      file://local/filesystem/path[#revision]
      http://[user[:pass]@]host[:port]/[path][#revision]
      https://[user[:pass]@]host[:port]/[path][#revision]
      ssh://[user[:pass]@]host[:port]/[path][#revision]
    
    Paths in the local filesystem can either point to Mercurial repositories
    or to bundle files (as created by 'hg bundle' or 'hg incoming --bundle').
    
    An optional identifier after # indicates a particular branch, tag, or
    changeset to use from the remote repository. See also 'hg help revisions'.
    

    【讨论】:

    • Url file://local/filesystem/path[#revision] 解决了我的问题。感谢您的帮助。
    【解决方案2】:

    克隆作业的一个问题是,一旦您点击克隆按钮,就会创建“克隆”作业。当您仍在配置克隆作业时,它可能会触发构建触发器,例如 SCM 轮询事件,导致它在您完全配置它之前启动。

    我相信这在后来的 Hudson 版本中已得到修复,但找不到作业克隆的更改日志条目。克隆从属配置也存在同样的问题,该问题已在 Hudson 1.319 中修复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-07
      • 2013-02-27
      • 2011-06-04
      • 2016-11-11
      • 1970-01-01
      • 2014-07-18
      • 2011-01-29
      • 1970-01-01
      相关资源
      最近更新 更多