Can I turn off Hudson's automatic scheduled builds all at once?

We have a great Hudson setup with many scheduled builds working all the time. I'm currently trying to get one assembly to work fine, but I sometimes have to wait until a scheduled assembly enters the queue. Is there a way to disable all scheduled assemblies so that I can concentrate on my complex assembly without changing the cron settings for each individual assembly?

+3
source share
6 answers

Tell him to prepare for closing.


OP (banjollity)
, , " ", .

  • , . .
  • , , . ( ).
  • .
  • 1.
+4

" slicing" , , cron . , .

+4

Mikezx6r, , :

[user@server jobs] $ for i in *build_name*; do sed -i s/"disabled>false"/"disabled>true/" $i/config.xml; done

"for":

[user@server jobs] $ for i in build1 build2 build3; do sed -i s/"disabled>false"/"disabled>true/" $i/config.xml; done

, , , "" sed:

[user@server jobs] $ for i in build1 build2 build3; do echo sed -i s/"disabled>false"/"disabled>true/" $i/config.xml; done

, , sed script:

[user@server jobs] $ for i in build1 build2 build3; do sed -i s/"disabled>true"/"disabled>false/" $i/config.xml; done

+2

, -, config.xml .

hudson config.xml. <project> , true, .

, script, , .

0

- , , ( , ).

" " . 7 8 , 8-. , !

0

jenkins Console. groovy script .

script . , TimerTrigger. ( )

import hudson.model.Hudson
import hudson.model.Project
import hudson.triggers.TimerTrigger
import hudson.triggers.Trigger
import hudson.triggers.TriggerDescriptor

//All the projects on which we can apply the getBuilders method
def allProjects = Hudson.instance.items.findAll { it instanceof Project }
def projectsToWorkOn = [];
allProjects.each { Project project ->
    Map<TriggerDescriptor, Trigger> triggers =
            project.getTriggers();
    triggers.each { trigger ->

        if (trigger.value instanceof TimerTrigger) {
            projectsToWorkOn.push(project)


        }

    }
}


projectsToWorkOn
        .each { Project project ->

    project.disable();
    project.save()
}
0

Source: https://habr.com/ru/post/1715513/


All Articles