Skip to content

Commit

Permalink
abortOnUnreadyDependency is now a Jenkins parameter
Browse files Browse the repository at this point in the history
to allow forcing the immediate build of a project even when dependencies are not ready.
This is useful to force a build that needs to go out immediately.
  • Loading branch information
ao-apps committed Sep 20, 2023
1 parent 2a0db0f commit f81be84
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ def upstreamProjects = [
* 'book/Jenkinsfile' -> 'book' *
* 'devel/Jenkinsfile' -> 'devel' *
* *
* abortOnUnreadyDependency Aborts the build when any dependency is queued, building, *
* or unsuccessful. *
* Defaults to true *
* *
* disableSubmodules Disables checkout of Git submodules. *
* Defaults to true *
* *
Expand Down Expand Up @@ -185,9 +181,6 @@ if (!binding.hasVariable('projectDir')) {
}
binding.setVariable('projectDir', projectDir)
}
if (!binding.hasVariable('abortOnUnreadyDependency')) {
binding.setVariable('abortOnUnreadyDependency', true)
}
if (!binding.hasVariable('disableSubmodules')) {
binding.setVariable('disableSubmodules', true)
}
Expand Down Expand Up @@ -600,6 +593,13 @@ pipeline {
defaultValue: "$buildPriority",
description: """Specify the priority of this build.
Defaults to project's depth in the upstream project graph."""
)
booleanParam(
name: 'abortOnUnreadyDependency',
defaultValue: true,
description: """Aborts the build when any dependency is queued, building, or unsuccessful.
Defaults to true and will typically only be false to push a new version of a project out immediately.
May also want to set BuildPriority to \"1\" to put at the top of the build queue."""
)
booleanParam(
name: 'requireLastBuild',
Expand All @@ -619,7 +619,7 @@ or any build that adds or removes build artifacts."""
stage('Check Ready') {
when {
expression {
return abortOnUnreadyDependency
return params.abortOnUnreadyDependency
}
}
steps {
Expand Down
16 changes: 8 additions & 8 deletions book/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ def upstreamProjects = [
* 'book/Jenkinsfile' -> 'book' *
* 'devel/Jenkinsfile' -> 'devel' *
* *
* abortOnUnreadyDependency Aborts the build when any dependency is queued, building, *
* or unsuccessful. *
* Defaults to true *
* *
* disableSubmodules Disables checkout of Git submodules. *
* Defaults to true *
* *
Expand Down Expand Up @@ -189,9 +185,6 @@ if (!binding.hasVariable('projectDir')) {
}
binding.setVariable('projectDir', projectDir)
}
if (!binding.hasVariable('abortOnUnreadyDependency')) {
binding.setVariable('abortOnUnreadyDependency', true)
}
if (!binding.hasVariable('disableSubmodules')) {
binding.setVariable('disableSubmodules', true)
}
Expand Down Expand Up @@ -604,6 +597,13 @@ pipeline {
defaultValue: "$buildPriority",
description: """Specify the priority of this build.
Defaults to project's depth in the upstream project graph."""
)
booleanParam(
name: 'abortOnUnreadyDependency',
defaultValue: true,
description: """Aborts the build when any dependency is queued, building, or unsuccessful.
Defaults to true and will typically only be false to push a new version of a project out immediately.
May also want to set BuildPriority to \"1\" to put at the top of the build queue."""
)
booleanParam(
name: 'requireLastBuild',
Expand All @@ -623,7 +623,7 @@ or any build that adds or removes build artifacts."""
stage('Check Ready') {
when {
expression {
return abortOnUnreadyDependency
return params.abortOnUnreadyDependency
}
}
steps {
Expand Down

0 comments on commit f81be84

Please sign in to comment.