Temporarily disable SCM polling on a Jenkins server on a Groovy system

We have a Jenkins server that runs from 20 to 30 jobs.

Since the assembly process is quite complex, we destroy the actual assembly into 1 substring, some of which can be performed simultaneously, others must follow the previous assembly steps. As a result, we grouped each step of the assembly into 3 groups, which are blocked when the assemblies are in immersion.

For instance:

Main Build : GroupA  : Builds A1, A2 & A3

           : GroupB  : Builds B1, B2 & B3

           : GroupC  : Builds C1, C2, C3, C4, C5 & C6

           : GroupD  : HW_Tests T1, T2, T3, T4 & T5


Builds B1, B2 & B3 rely on the output from A1, A2, A3 etc

, 24/7, Jenkins Master. " " , , , , GroupB , C1, C2 .. , Main Build .

, SCM , . , . Jenkins SCM, .

SCM - Perforce.

, , , , System Groovy... , . - , ?

+4
2

, SCM. groovy script :

Hudson.instance.items.each { job ->
  if ( job.getTrigger(  hudson.triggers.SCMTrigger ) != null ) {
    println "will disable job ${job.name}"
    job.disable()
  }
}

:)

+4
  • , SCM, . :)

  • jenkins job builder, .

  • , SCM JAVA? JAVA , -;) : P ;)

, !

0

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


All Articles