79384266

Date: 2025-01-24 12:04:14
Score: 0.5
Natty:
Report link

Note: Triggers have been deprecated and replaced by pipelineTriggers. For more details, refer to JENKINS-53775.

If you want to use disableConcurrentBuilds, Triggers (with pollSCM and cron) for a DSL job, you can achieve it using the following configuration:

pipelineJob(repoName) {
  properties {
    disableConcurrentBuilds()
    pipelineTriggers {
      triggers {
        pollSCM {
          scmpoll_spec('* * * * *') // Adjust the schedule as needed
          ignorePostCommitHooks(true)
        }
        cron {
          spec(cronTime) // Replace 'cronTime' with your desired cron schedule
        }
      }
    }
  }
}

Credit: Special thanks to Catrobat for providing the original implementation. You can find more details in their repository: https://github.com/Catrobat/Jenkins/blob/master/job_dsl/src/main/lib/JobBuilder.groovy

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Lovesh Bishnoi