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

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

问题描述

我有以下项目布局:




  • WAR项目A


    • 上游项目


      • 依赖项B

      • 依赖项C

      • 依赖项D





< m寻找设置A,以便每次我想触发一个构建,它将首先构建B,C和D.如果任一构建B,C或D失败,那么A的构建也应该失败。



这似乎是一个常见的构建情况,但我不知道如何完成它。有以下选项,但它们似乎没有正确的关系:




  • 构建触发器 - 构建其他项目后构建


    • 在一些上游项目之后构建当前项目,但是我在执行WAR部署时需要从这个项目控制构建。


  • 后期构建操作 - 构建其他项目




b
$ b

在Hudson(或通过插件)中是否有可以为我工作的构建配置?

解决方案

这是最近在哈德森邮件列表。在Hudson中没有对这种类型的构建配置的直接支持。



请参阅此线程:
http://jenkins.361315.n4.nabble.com/On -demand-build-dependency-handling-simple-2-job-build-td624395.html



您可以使用Join插件来创建 +部署作业。它将B,C和D作为下游项目,然后'A'将成为联合目标。



因此B C和D需要成功完成。如果是这样,那么A的简单部署作业将被启动。如果有任何错误,A不会启动。这实际上与您要求的相同。



您可以在这里阅读连接插件:
http://wiki.hudson-ci.org/display/HUDSON/Join+Plugin


I have the following project layout:

  • WAR Project A
    • Upstream Projects
      • Dependency B
      • Dependency C
      • Dependency D

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:

  • Build Triggers - Build after other projects are built
    • Will build the current project after some upstream projects, but I need to control the build from this project since I'm doing a WAR deployment. I just want to always build dependencies first.
  • Post-build Actions - Build other projects
    • Will build projects after this one, but that's backwards for what I want to do.

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

解决方案

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

See this thread: http://jenkins.361315.n4.nabble.com/On-demand-build-dependency-handling-simple-2-job-build-td624395.html

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.

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.

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

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

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