-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Skip scheduled I/Y-build if nothing has changed since last build
Fixes #678
- Loading branch information
1 parent
53071c7
commit 56aa817
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,6 +208,9 @@ spec: | |
} | ||
} | ||
stage('Tag Build Inputs'){ | ||
environment { | ||
ABORT_IF_NO_CHANGES = "${!currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').isEmpty()}" // true, if triggered by timer | ||
} | ||
steps { | ||
sshagent (['git.eclipse.org-bot-ssh', 'github-bot-ssh', 'projects-storage.eclipse.org-bot-ssh']) { | ||
sh \'\'\' | ||
|
@@ -220,6 +223,16 @@ spec: | |
fi | ||
\'\'\' | ||
} | ||
script { | ||
if (env.ABORT_IF_NO_CHANGES && fileExists("${WORKSPACE}/noChanges")) { | ||
emailext subject: "${env.BUILD_VERSION} I-Build: ${env.BUILD_IID.trim()} - BUILD SKIPPED", | ||
body: "The scheduled build was skipped because no changes have been made since the last successful build.<br>For details see <a href='${BUILD_URL}console'>${BUILD_URL}console</a><br>", | ||
to: '[email protected]', | ||
from: '[email protected]' | ||
currentBuild.result = 'ABORTED' | ||
error('Abort scheduled build due to no changes') | ||
} | ||
} | ||
} | ||
} | ||
stage('Aggregator maven build'){ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,6 +205,9 @@ spec: | |
} | ||
} | ||
stage('Tag Build Inputs'){ | ||
environment { | ||
ABORT_IF_NO_CHANGES = "${!currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').isEmpty()}" // true, if triggered by timer | ||
} | ||
steps { | ||
sshagent (['git.eclipse.org-bot-ssh', 'github-bot-ssh', 'projects-storage.eclipse.org-bot-ssh']) { | ||
sh \'\'\' | ||
|
@@ -217,6 +220,16 @@ spec: | |
fi | ||
\'\'\' | ||
} | ||
script { | ||
if (env.ABORT_IF_NO_CHANGES && fileExists("${WORKSPACE}/noChanges")) { | ||
emailext subject: "${env.BUILD_VERSION} I-Build: ${env.BUILD_IID.trim()} - BUILD SKIPPED", | ||
body: "The scheduled build was skipped because no changes have been made since the last successful build.<br>For details see <a href='${BUILD_URL}console'>${BUILD_URL}console</a><br>", | ||
to: '[email protected]', | ||
from: '[email protected]' | ||
currentBuild.result = 'ABORTED' | ||
error('Abort scheduled build due to no changes') | ||
} | ||
} | ||
} | ||
} | ||
stage('Aggregator maven build'){ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters