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 4692d14 commit 98f01ea
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 @@ -66,10 +66,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 @@ -175,9 +171,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 @@ -590,6 +583,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 @@ -609,7 +609,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 @@ -74,10 +74,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 @@ -183,9 +179,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 @@ -598,6 +591,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 @@ -617,7 +617,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 98f01ea

Please sign in to comment.