Child pages
  • Display the number of jobs using SCM Polling from Freestyle, Pipeline and Maven

Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata
import hudson.triggers.*

import hudson.maven.MavenModuleSet
import org.jenkinsci.plugins.workflow.job.*
 
def logSpec = { it, getTrigger -> String spec = getTrigger(it)?.getSpec(); if (spec) println (it.getFullName() + " with spec " + spec)}
 
println("--- SCM Polling for Pipeline jobs ---")
Jenkins.getInstance().getAllItems(WorkflowJob.class).each() { logSpec(it, {it.getSCMTrigger()}) }
 
println("\n--- SCM Polling for FreeStyle jobs ---")
Jenkins.getInstance().getAllItems(FreeStyleProject.class).each() { logSpec(it, {it.getSCMTrigger()}) }
 
println("\n--- SCM Polling for Maven jobs ---");
Jenkins.getInstance().getAllItems(MavenModuleSet.class).each() { logSpec(it, {it.getTrigger(SCMTrigger.class)}) }

println '\nDone.'

*Sharing for the benefits of others. I'm not the original creator.

  • No labels