Is there a way to run all jobs in one hudson's view by pressing just one button? Thanks.
Use mulijob in the following way: When creating new Jenkins jobs you will have an option to create MultiJob project. In the build section, this job can define phases that contain one or more jobs. All jobs that belong to one phase will be executed in parallel (if there are enough executors on the node)
Update: here is the solution
Edit your view's description and paste this code into it:
<script type="text/javascript">
<!--
function triggerBuilds(obj){
obj.responseText.evalJSON()['jobs'].each(
function(i){
new Ajax.Request(i['url']+'build',{method:'GET'});
}
);
}
function buildAll(){
new Ajax.Request(
document.URL.replace(/[\W]+$/,'') + '/api/json',
{
onSuccess : triggerBuilds,
method : 'GET'
}
);
}
//-->
</script>
<a href="javascript:buildAll();void(0)">Build all Jobs in this view</a>
This will create a link that builds all jobs in the current view using hudson's JSON api. (Only works from the view, if you want to use it from somewhere else you have to change the relative URLs).
(this solution relies on prototype which is present in current versions of hudson, but I don't know how long it has been present, so this may not work for older versions)
or create a bookmarklet for this URL:
javascript:var%20f=function(obj){obj.responseText.evalJSON()['jobs'].each(function(i){new%20Ajax.Request(i['url']+'build',{method:'GET'});});};new%20Ajax.Request(document.URL.replace(/[\W]+$/,'')+'/api/json',{onSuccess:f,method:'GET'});void(0)
in your bookmark menu and execute it on any hudson view you like
Edit: I have elaborated on this answer on my weblog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With