Reputation: 614
I am working with a multi-configuration Jenkins project. The two configuration axes are Win/Linux and 32/64-bit. I would like to build the primary configuration (32-bit Windows) whenever version control changes, but to only build the other configurations once weekly (just to make sure that they stay reasonably up to date).
Is it possible to achieve this schedule without breaking the project up into multiple individual projects?
Upvotes: 1
Views: 697
Reputation: 4075
Please consider this:
Why not build ALL available configurations EVERY time?
- after all, that is the whole idea of Continuous Integration...
Can drop the artifacts of those builds after a short period of time,
so they don't clog your disk, but if anything breaks your build - you will know it right away.
Can also set the slaves' queue to run a single job at a time, so the builds don't overload the build-servers.
The other solution requires:
Set Job_A1 as a weekly scheduler that triggers Job_B (the main multi-configuration build process).
Set Job_A2 to run Job_B whenever there are source-code changes.
Set Job_B to know if it was triggered by Job_A1 or Job_A2 (can pass its name as a parameter),
and also set Job_B to ignore calls from Job_A2 ("exit 0"), if the current config. differs from Windows-32bit.
This way, all 4 configurations will run whenever there are source-control changes, but only one will actually build.
Good luck!
Upvotes: 1
Reputation: 9503
Unfortunately not through Jenkins directly at this point AFAIK. There is only one time handler per job, and the multi-configuration is a single job, it has a single timer.
There is a hack, but it will be tough, and I'm not sure of the exact script required, but if you can check the day of the week, you could try something like this in your script:
if (day == Sunday |OR| $NODE_NAME == win32), then:
<carry out build steps here>
finish
This way:
Note that $NODE_NAME
is a standard Jenkins environment variable. However, this assumes that your build is done through either "Execute Shell" or "Execute Windows Batch"
Is there any reason the others shouldn't build at the same time?
You could create two jobs, one for your primary so it is a free-style job, and the other as a multi-configuration with Win64/Linux and leave that on a separate, weekly timer.
Upvotes: 1