diff --git a/Jenkinsfile b/Jenkinsfile index 751dd2e0..e5a37a3c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -124,8 +124,8 @@ def upstreamProjects = [ * 10 + buildPriority * 2 * * * * nice The nice level to run the build processes or 0 for none. * - * Default depends on buildPriority: * - * min(19, buildPriority - 1) * + * Default depends on params.BuildPriority: * + * min(19, params.BuildPriority - 1) * * * * maven The Maven tool to use. * * Defaults to 'maven-3' * @@ -449,8 +449,9 @@ if (!binding.hasVariable('quietPeriod')) { binding.setVariable('quietPeriod', 10 + buildPriority * 2) } if (!binding.hasVariable('nice')) { - def nice = buildPriority - 1; - if (nice > 19) nice = 19; + def nice = (params.BuildPriority as Integer) - 1; + if (nice < 0) nice = 0; + else if (nice > 19) nice = 19; binding.setVariable('nice', nice) } if (!binding.hasVariable('maven')) { @@ -603,6 +604,7 @@ pipeline { name: 'BuildPriority', defaultValue: "$buildPriority", description: """Specify the priority of this build. +Must be between 1 and 30, with lower values built first. Defaults to project's depth in the upstream project graph.""" ) booleanParam( diff --git a/book/Jenkinsfile b/book/Jenkinsfile index aabf9778..9c1620dd 100644 --- a/book/Jenkinsfile +++ b/book/Jenkinsfile @@ -122,8 +122,8 @@ def upstreamProjects = [ * 10 + buildPriority * 2 * * * * nice The nice level to run the build processes or 0 for none. * - * Default depends on buildPriority: * - * min(19, buildPriority - 1) * + * Default depends on params.BuildPriority: * + * min(19, params.BuildPriority - 1) * * * * maven The Maven tool to use. * * Defaults to 'maven-3' * @@ -447,8 +447,9 @@ if (!binding.hasVariable('quietPeriod')) { binding.setVariable('quietPeriod', 10 + buildPriority * 2) } if (!binding.hasVariable('nice')) { - def nice = buildPriority - 1; - if (nice > 19) nice = 19; + def nice = (params.BuildPriority as Integer) - 1; + if (nice < 0) nice = 0; + else if (nice > 19) nice = 19; binding.setVariable('nice', nice) } if (!binding.hasVariable('maven')) { @@ -601,6 +602,7 @@ pipeline { name: 'BuildPriority', defaultValue: "$buildPriority", description: """Specify the priority of this build. +Must be between 1 and 30, with lower values built first. Defaults to project's depth in the upstream project graph.""" ) booleanParam( diff --git a/devel/Jenkinsfile b/devel/Jenkinsfile index 89c2366d..fd90eb9e 100644 --- a/devel/Jenkinsfile +++ b/devel/Jenkinsfile @@ -100,8 +100,8 @@ def upstreamProjects = [ * 10 + buildPriority * 2 * * * * nice The nice level to run the build processes or 0 for none. * - * Default depends on buildPriority: * - * min(19, buildPriority - 1) * + * Default depends on params.BuildPriority: * + * min(19, params.BuildPriority - 1) * * * * maven The Maven tool to use. * * Defaults to 'maven-3' * @@ -425,8 +425,9 @@ if (!binding.hasVariable('quietPeriod')) { binding.setVariable('quietPeriod', 10 + buildPriority * 2) } if (!binding.hasVariable('nice')) { - def nice = buildPriority - 1; - if (nice > 19) nice = 19; + def nice = (params.BuildPriority as Integer) - 1; + if (nice < 0) nice = 0; + else if (nice > 19) nice = 19; binding.setVariable('nice', nice) } if (!binding.hasVariable('maven')) { @@ -579,6 +580,7 @@ pipeline { name: 'BuildPriority', defaultValue: "$buildPriority", description: """Specify the priority of this build. +Must be between 1 and 30, with lower values built first. Defaults to project's depth in the upstream project graph.""" ) booleanParam(