在下游项目之前触发上游项目构建 [英] Triggering upstream project builds before downstream project

查看:23
本文介绍了在下游项目之前触发上游项目构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下项目布局:

  • WAR 项目 A
    • 上游项目
      • 依赖 B
      • 依赖C
      • 依赖 D

      我希望设置 A,这样每次我想触发构建时,它都会首先构建 B、C 和 D.如果 B、C 或 D 的构建失败,那么 A 的构建也应该失败.

      I'm looking to setup A so that every time I want to trigger a build, it will first build B, C, and D. If either builds for B, C, or D fail then A's build should fail as well.

      这似乎是一个常见的构建案例,但我不确定如何完成.有以下选项,但它们似乎没有正确的关系:

      It seems like a common build case, but I'm not sure how to accomplish it. There are the following options but they don't seem to have the right relationship:

      • 构建触发器 - 在构建其他项目之后构建
        • 将在一些上游项目之后构建当前项目,但我需要控制这个项目的构建,因为我正在进行 WAR 部署.我只想始终先构建依赖项.
        • 将在此之后构建项目,但这与我想做的事情相反.

        Hudson 中(或通过插件)是否有适合我的构建配置?

        Is there a build configuration in Hudson (or through a plugin) that will work for me?

        推荐答案

        这个问题最近出现在 Hudson 邮件列表中.Hudson 中没有直接支持这种类型的构建配置.

        This came up on the Hudson mailing list very recently. There is no direct support for this type of build configuration in Hudson.

        看到这个线程:http://jenkins.361315.n4.nabble.com/On-demand-build-dependency-handling-simple-2-job-build-td624395.html

        您可以使用 Join 插件来创建构建+部署"作业.它将 B、C 和 D 作为下游项目,然后A"将成为连接目标.

        You could use the Join plugin to create a 'build+deploy' job. It would have B,C and D as downstream projects, and then 'A' would become the join target.

        因此 B C 和 D 需要成功完成.如果是这样,则将启动 A 的普通部署"作业.如果有任何错误,A 将不会启动.这实际上与您的要求相同.

        Thus B C and D would need to complete successfully. If so, then the plain 'deploy' job of A would be launched. If there were any error, A would not launch. This is effectively the same as what you are asking for.

        您可以在此处阅读有关加入插件的信息:http://wiki.hudson-ci.org/display/HUDSON/Join+插件

        You can read about the join plugin here: http://wiki.hudson-ci.org/display/HUDSON/Join+Plugin

        这篇关于在下游项目之前触发上游项目构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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