We have a pipeline which generally looks like the following:

properties([parameters([
booleanParam(defaultValue: false, description: '', name: 'ARMv8')])])

pipeline {
  agent any
  stage('build') {
    options {
      skipDefaultCheckout true
    }
    when { expression { return params.ARMv8 } }
    agent { label 'armv8' }
    steps {
      script {
        sh "echo 'steps goes here'"
      }
    }
  }
}



The main idea is to skip a build on specific agents unless the parameter is 
set in `properties` section (which is checked in `when` statement). 
Regardless, Jenkins tries to allocate agent anyways and ONLY THEN gives up 
on `when` statement. Some agents may not be available the time a build 
starts. This leads to a long waiting time while Jenkins tries to allocate 
the agent that is offline.

It looks like the following in the logs:
[ARMv8] Still waiting to schedule task
[ARMv8] arm8-1 is offline

Is it possible to force skipping the agent allocation? I.e., check the 
`when` statement first and continue with other steps IFF property is set to 
true?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1d5231f4-f645-4813-b8fe-4d04641b38e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to