Run a pre-script to determine if a Jenkins matrix job should be run
I have a Je开发者_开发百科nkins job consisting of a matrix style configuration. I want to run a script that determines whether that combination should be run (similar to the combination filter, but dynamic). Thus setting the job to 'No Run' (grey) or running the rest of the scripts over it and producing a result.
Is there a way (or a plugin) to do this? In the event there isn't is there a way to set a job to 'No Run' once it has started running?
Cheers, Stu
Edit: Discussion at:
http://groups.google.com/group/jenkinsci-users/browse_thread/thread/d99e865b17575e92/6c83ee0f894980fb?lnk=gst&q=dynamic#6c83ee0f894980fb
Suggests two plugins, but perhaps a pre script looking at the previous build is just as easy.
I've done the same things.
I can't do that in matrix filter feature because it's not dynamic.
So what I've done is to add to my build script 2 groovy (pre and post) which determinate if the build should be done or not.
The first script look for a old build execution log file to determine if the current build should be done or not and save the state in a file named disabled at the root of the workspace.
The build process only continue if disabled file is not present.
The second groovy script is to store that a particular build is done and store it for further execution and remove the file.
With this method, I can do a round-robin build of 50 configuration, 6 per day.
The only problem I add is that all build are launched so all are green, and we can't quickly see which build have been really done.
Regards,
Ludovic SMADJA JALIOS - R&D http://www.jalios.com
精彩评论