Reputation: 1741
Our Software project contains Perl, C & VC++ code. I am trying to set up Hudson in the master/slave configuration to manage the build & test process. I have one linux box running as master and windows XP (32-bit), Windows 7 (64-bit), linux boxes running as slaves. The build process involves building specific parts of the project on specific machines. So I want to build 32-bit version of our VC++ code on XP box & 64-bit version on Windows 7. Similarly, I have to compile the C code on linux box using gcc. And finally when all is done, kick off the Perl unit tests to ensure all is fine.
There are two questions related to this:
1) I couldn't figure out where in the configuration of a job can I say "run build-32.bat on windows xp slave" & "run build-64.bat on Windows 7 slave" and so on. So in short, I am trying to tie specific parts of the build process to specific slaves. How can I do that?
2) When I run the batch files to complete the build process, how does Hudson know whether my build was successful or not? I couldn't find any part where I can capture the build scripts output & analyze it. Or should I be doing it some other way?
Thanks for your help.
Upvotes: 1
Views: 905
Reputation: 16305
1) different slaves
Ok, If I understand you right, you need to run the "same" project on different machines. If they are not dependent on each other, than you can try to use the multi configuration job. You just need to make sure to somehow trigger different build scripts depending on the slaves.
Usually, the unit tests are run after building the code. The way you describe it, it sounds more like a integration test that involves all three components. In that case you probably need another job for running the unit (?) tests.
To my knowledge there is no way (besides the multi configuration project) to have different parts of one job run on different slaves. In this case you have to create more than one job and chain them. The advantage of several jobs is the ability to parallelize build steps using the join plugin. Unfortunately, slicing the job creates a lot of clutter and is more difficult to maintain.
2) Batch file
Hudson uses the errorlevel (or exit code). To be save you should always set the exit code by calling exit /B <error_code>
as the last command of your script. Replace with 0 if successful or a non-zero value for an error. You should also call all your batch files with the call command, e.g. call mybatch.bat Param1 Param2
.
Upvotes: 1
Reputation: 1324318
I am not sure if this can be achieved within one job.
But you could set up your different steps on different jobs (each tied to the right slave), and control their execution and coordination through the Join Hudson Plugin.
Upvotes: 1