哈德森的依赖 [英] Hudson dependencies

查看:156
本文介绍了哈德森的依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了我的哈德森工作A.作业A取决于作业B和C.我已经将它们与建设等项目。这种运作良好,虽然每个工作是在我的工作区(默认结构)单独的目录。但我需要在作业的作业B和C的工作区(根文件夹)。

I have set up my hudson job A. Job A depends on job B and C. I have set them up with "Build other projects". This works well, although each job is in separate directory in my workspace (default structure). But I need job B and C in jobs A workspace (root folder).

我已经考虑两种方法:


  1. 更改作业的工作区,并通过关于其他项目的触发参数化建变量推作业,然后使用Ant构建脚本将它们复制到该位置,因为我无法找到一个选项来改变文件夹,作业B或C应该去

  2. 触发任务,从构建脚本A.工作的一部分,这是通过远程调用做B,然后C(发现它某处计算器),但该选项在我的配置失踪,我无法找到,将其添加任何插件。

理想的方法,我将使用Ant构建脚本,并从那里触发任务B和C,antsvn或类似的东西。但我不能找到这样一个坚实的例子。

Ideal approach for me would be to use ant build script and trigger job B and C from there with antsvn or something like that. But I cant find a solid example of this.

我之所以想这样的方式很简单 - 工作B是CMS是来找工作的本质和作业C有需要之前新版本被执行可以生产服务器上的土地(这已经与PY-完成Python脚本蚂蚁)。

Reason why I want it this way is simple - job B is CMS which is essential for job A and job C has python scripts that need to be executed before new version can land on production server (this is already done with py-ant).

或许有管理这样一些依赖更好的办法。任何帮助是AP preciated。

Or maybe there is some better way to manage dependencies like this. Any help is appreciated.

我希望这是有道理的。

推荐答案

想想乔布斯B和C作为生产神器约伯A的需求。然后,所有你需要做的就是通过导入作业B和C只要构建工作A。生成的工件

Think of Jobs "B" and "C" as producing "artifacts" that Job "A" needs. Then, all you have to do is import the artifacts produced by Jobs "B" and "C" whenever you build Job "A".

您的工作不应该共享的工作空间。否则,会发生什么,如果作业,工作B或C被触发时,建设?您将有多个同时建立回事。但是,如果单独拿出什么是A,从就业B和C的需要,可以有作业,进口这些依赖。这样做有两种方式:

Your jobs shouldn't share workspaces. Otherwise what happens if Job "A" is building when Job "B" or "C" is triggered? You'll have multiple builds going on at once. However, if you separate out what "A" needs from jobs "B" and "C", you can have Job "A" import those dependencies. There are two ways of doing this:


  • 的辛苦,但的正确的方法:您应该创建一个的发行库的就业机会在哪里可以获取他们所需要的工件。如果这听起来的 Mavinish 的给你,好了,这是。不过,我已经使用Maven的建筑的东西,而Maven项目,它工作正常。您可以使用类似Artifactory的或Nexus作为您的版本库。然后使用的wget 卷曲来获取从资源库中的项目,并使用Maven的部署:部署-file 插件来送过东西。你需要的Maven(这是一个Java程序)来运行部署:部署文件,但你并不需要一个Maven项目,甚至是一个Java项目。在部署:部署文件插件甚至不需要一个Maven 的pom.xml 文件。你可以把它更像是一个命令行实用程序发送的东西到你的版本库中。

  • 的容易,但是的不正确的方法:哈德森拥有的复制神器插件,你可以用它来做到这一点。现在的问题是,它很容易设置,但很难开始跟踪。此外,它让你依赖于一个非常特殊的工具。如果您决定摆脱哈德森的时候,你可能无法复制此功能。

  • The hard but correct way: You should create a release repository where jobs can fetch the artifacts they need. If this sounds Mavinish to you, well, it is. However, I've used Maven architectural stuff without Maven projects and it works fine. You can use something like Artifactory or Nexus as your release repository. Then use wget or curl to fetch the items from the repository and use Maven's deploy:deploy-file plugin to send the stuff over. You will need Maven (which is a Java process) to run deploy:deploy-file, but you don't need a Maven project, or even a Java project. The deploy:deploy-file plugin doesn't even require a Maven pom.xml file. Think of it more like a command line utility to send stuff to your release repository.
  • The easy, but incorrect way: Hudson has a Copy Artifacts plugin that you can use to do this. The problem is that it's easy to setup, but hard to start tracking. Plus, it makes you dependent upon a very specific tool. If you decide to move away from Hudson, you might not be able to duplicate this functionality.

这篇关于哈德森的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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