Hudson: complete all tasks in one-click view

Is there a way to run all jobs in one hudson mode by pressing only one button? Thank.

+5
source share
2 answers

Update: here is the solution

Change the description of your view 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 the hudson JSON api. (Only works in terms of, if you want to use it from another place, you need to change the relative URLs).

(This solution relies on a prototype that 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)

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)

,


: -.

+2

( maven ).

Join Plugin , .

0

All Articles