简体   繁体   English

Hudson的另类构建经理

[英]Alternative build manager to Hudson

I work at a software company where our primary development language is Java. 我在一家软件公司工作,我们的主要开发语言是Java。 Naturally, we use Hudson for continuous builds, which it works brilliantly for. 当然,我们使用Hudson进行连续构建,它的工作非常出色。 However, Hudson is not so good at some of the other things we ask it to do. 然而,哈德森对我们要求它做的其他一些事情并不擅长。 We also use Hudson jobs to deploy binaries, refresh databases, run load testing, run regressions, etc. We really run into trouble when there are build dependencies (ie load testings requires DB refresh). 我们还使用Hudson作业来部署二进制文件,刷新数据库,运行负载测试,运行回归等。当存在构建依赖性时(即负载测试需要DB刷新),我们确实遇到了麻烦。

Here's the one thing that Hudson doesn't do that we really need: 这是哈德森没有做到的一件我们真正需要的事情:

Build dependency: It supports build dependencies for Ant builds, but not for Hudson jobs. 构建依赖关系:它支持Ant构建的构建依赖关系,但不支持Hudson作业。 We're using the URL invocation feature to cause a Hudson job to invoke another Hudson job. 我们使用URL调用功能导致Hudson作业调用另一个Hudson作业。 The problem is that Hudson always returns a 200 and does not block until the job is done. 问题是Hudson总是返回200并且在作业完成之前不会阻塞。 This means that the calling job doesn't know a) if the build failed and b) if it didn't fail, how long it took. 这意味着调用作业不知道a)构建是否失败以及b)如果没有失败,则需要多长时间。

It would be nice to not have to use shell scripting to specify the behavior of a build, but that's not totally necessary. 不必使用shell脚本来指定构建的行为会很好,但这并不是完全必要的。

Any direction would be nice. 任何方向都会很好。 Perhaps we're not using Hudson the right way (ie should all builds be Ant builds?) or perhaps we need another product for our one-click deployment, load testing, migration, DB refresh, etc. 也许我们没有以正确的方式使用Hudson(即所有构建都应该是Ant构建吗?)或者我们可能需要另一种产品来进行一键式部署,负载测试,迁移,数据库刷新等。

Edit: 编辑:

To clarify, we have parameters in our builds that can cause different dependencies depending on the parameters. 为了澄清,我们的构建中的参数可能会根据参数导致不同的依赖关系。 Ie sometimes we want load testing with a DB refresh, sometimes without a DB refresh. 即有时我们希望通过数据库刷新进行负载测试,有时不需要数据库刷新。 Unfortunately, creating a Hudson job for each combination of parameters (as the Join plugin requires) won't work because sometimes the different combinations could lead to dozens of jobs. 不幸的是,为每个参数组合创建Hudson作业(如加入插件所需)将无法工作,因为有时不同的组合可能会导致数十个作业。

I don't think I understand your "build dependency" requirements. 我不认为我理解你的“构建依赖”要求。 Any Hudson job can be configured to trigger another (downstream) job, or be triggered by another (upstream) job. 可以将任何Hudson作业配置为触发另一个(下游)作业,或者由另一个(上游)作业触发。

The Downstream-Ext plugin and Join plugin allow for more complex definition of build dependencies. Downstream-Ext插件Join插件允许更复杂的构建依赖关系定义。

There is a CLI for Hudson which allows you to issue commands to a Hudson instance. Hudson有一个CLI,允许您向Hudson实例发出命令。 Use "help" to get precise details. 使用“帮助”获取精确的详细信息。 I believe there is one which allows you to invoke a build and await its finish. 我相信有一个允许你调用构建并等待它完成。

http://wiki.hudson-ci.org/display/HUDSON/Hudson+CLI http://wiki.hudson-ci.org/display/HUDSON/Hudson+CLI

Do you need an extra job for your 'dependencies'? 你需要为你的“依赖”做额外的工作吗?

Your dependencies sound for me like an extra build step. 你的依赖对我来说就像一个额外的构建步骤。 The script that refreshes the DB can be stored in your scm and every build that needs this step will check it out. 刷新数据库的脚本可以存储在您的scm中,每个需要此步骤的构建都会将其检出。 You can invoke that script if your parameter "db refresh" is true. 如果参数“db refresh”为true,则可以调用该脚本。 This can be done with more than just one of your modules. 这可以通过多个模块完成。 What is the advantage? 有什么好处? Your script logic is in your scm (It's always good to have a history of the changes). 您的脚本逻辑在您的scm中(拥有更改历史记录总是很好)。 You still have the ability to update the script once for all your test jobs (since hey all check out the same script). 您仍然可以为所有测试作业更新一次脚本(因为他们都会检查相同的脚本)。 In addition you don't need to look at several scripts to find out whether your test ran successful or not. 此外,您不需要查看几个脚本来确定测试是否成功。 Especially if you have one job that is part of several execution lines, it becomes difficult to find out what job triggered which run. 特别是如果您有一个作业是多个执行行的一部分,则很难找出触发哪个作业的作业。 Another advantage is that you have less jobs on your Hudson and therefore it is easier to maintain. 另一个优点是您在Hudson上的工作量较少,因此维护起来更容易。

I think what you are looking for is http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin This plugin lets you execute other jobs based on the status of previous jobs. 我认为您正在寻找的是http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin此插件允许您根据以前作业的状态执行其他作业。 You can even call a shell script from the downstream project to determine any additional conditions. 您甚至可以从下游项目调用shell脚本来确定任何其他条件。 which can in turn call the API for more info. 它可以反过来调用API以获取更多信息。

For example we have a post-build step to notify us, this calls back the JSON API to build a nice topic in our IRC channel that says "All builds ok" or "X,Y failed" , etc. 例如,我们有一个后期构建步骤来通知我们,这将回调JSON API,在我们的IRC频道中构建一个很好的主题,说“所有构建正常”或“X,Y失败”等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM