开发者

Hudson interactive mode:- Is there one?

I'm pretty new to hudson bui开发者_高级运维ld system. I currently have my builds run from combination of perl/cgi scripts, with ability to start from a browser. What I need is an ability in hudson to checkout a file from perforce (can do that), parse that file (i can write a script for this) and based on the result of the parse give the user ability to choose various different options on what to build (compile). Is this possible? I'm not sure if I should tie together couple of different projects to do this or not? Any ideas on this could be achieved would be very helpful.


Hudson is a Continuous Integration (CI) server. All CI servers have in common that they help you to automate the build process so that you don't need to have user interactions. In addition to builds you can add unit testing, functional testing, code analysis, package your solution, ..... So obviously the concept of CI does not cater your current needs or expectations (at least if you intend to use it the way it was intended to be used).

I your case I would have a critical look at your build process and figure out whether the design of the process can be adapted to be fully automated or not. It is perfectly OK, to build everything with the CI solution, even if it takes a while. This way, you don't need user interaction and you will now right away if a component is broke (the actual purpose of CI). Be sure to investigate all of the many Hudson plugins. Depending on how often your build parameters actually change, you might be able to run a matrix build and all possible (and valid) combinations of build parameters in one job. Needless to say the possible options need to be known to the job before it is triggered.

One (of many) possible workarounds for what you want to do, might be to have two jobs, the first one checks out the file from per force and creates an HTML page with the possible options and stores it as an artifact. The HTML page lets you choose your options and triggers on your request a second job in Hudson. The chosen options will be passed into the second job as one (or many) parameters. Which than builds the projects depending on the options passed into it. You can also change the second job configuration using the remote API, in this case the available options will be set as choice parameters in the second job. When a you trigger the second job manually, you just need to set your choice of parameters and you are good to go. This is an ugly workaround and I would not recommend it.


No, there is no way. Hudson is designed to run without user interaction. That's the whole point -- you set up jobs that run on a schedule or run whenever code is checked in.

Instead of requiring user interaction, create separate jobs for the most common tasks. That way they can click on whichever job suits their need.


You can use Hudson parameterised builds - there should be a check-box to allow you to select that a build is parameterised and to add parameters.

Of course, this won't let you get the list of parameters from the build itself as it can't look into the future but if you know what they're going to be ahead of time you can just have them passed from Hudson to your script at the appropriate point.

http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜