Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55327

Job restrictions can be skipped if no node block in Jenkinsfile

XMLWordPrintable

      Try following Jenkinsfile, it will always run on master, even you configured job restriction

      #!/usr/bin/env groovy
      timeout(time: 5, unit: 'MINUTES') {
        timestamps {
          properties([buildDiscarder(logRotator(daysToKeepStr: '7', artifactDaysToKeepStr: '0'))])
          stage('printing') {
            for ( i=1; i<10; i++ ) {
              println "Round ${i} checking"
              sleep 1
            }
          }
        }
      } 

            Unassigned Unassigned
            joelee Joe Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: