...
 
Commits (2)
......@@ -97,6 +97,10 @@ builders = pipelineBuilder.createBuilders { container ->
// Checkout code on coordinator node and start builders in parallel.
node {
checkout scm
// Abort build if commit message contains '[ci skip]'.
abortBuildOnMagicCommitMessage()
try {
// Only run macOS pipeline if a node is online.
if (NodeStatus.isMacOSOnline()) {
......
......@@ -121,18 +121,20 @@ class PipelineBuilder implements Serializable {
}
/**
*
* Abort build if commit message contains '[ci skip]', except for PR builds.
*/
def abortBuildOnMagicCommitMessage() {
def r = script.sh(
script: "git log -1 | grep '\\[ci skip\\]'",
returnStatus: true
)
if (r == 0) {
script.echo "Ignoring this build because of commit message"
script.currentBuild.result = 'ABORTED'
script.error('Build skipped')
if (script.env.CHANGE_ID == null) {
def r = script.sh(
script: "git log -1 | grep '\\[ci skip\\]'",
returnStatus: true
)
if (r == 0) {
script.echo "Ignoring this build because of commit message"
script.currentBuild.result = 'ABORTED'
script.error('Build skipped')
}
}
}
......