diff --git a/Jenkinsfile b/Jenkinsfile index 0e38618575a..e86f92f5099 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -120,37 +120,40 @@ for (def jdk in jdks) { } } - // True if this build is part of the "active" branches - // for Jetty. - def isActiveBranch() +} + + +// True if this build is part of the "active" branches +// for Jetty. +def isActiveBranch() +{ + def branchName = "${env.BRANCH_NAME}" + return ( branchName == "master" || + branchName.startsWith("jetty-") ); +} + +// Test if the Jenkins Pipeline or Step has marked the +// current build as unstable +def isUnstable() +{ + return currentBuild.result == "UNSTABLE" +} + +// Send a notification about the build status +def notifyBuild(String buildStatus) +{ + if ( !isActiveBranch() ) { - def branchName = "${env.BRANCH_NAME}" - return ( branchName == "master" || - branchName.startsWith("jetty-") ); + // don't send notifications on transient branches + return } - // Test if the Jenkins Pipeline or Step has marked the - // current build as unstable - def isUnstable() - { - return currentBuild.result == "UNSTABLE" - } + // default the value + buildStatus = buildStatus ?: "UNKNOWN" - // Send a notification about the build status - def notifyBuild(String buildStatus) - { - if ( !isActiveBranch() ) - { - // don't send notifications on transient branches - return - } - - // default the value - buildStatus = buildStatus ?: "UNKNOWN" - - def email = "${env.EMAILADDRESS}" - def summary = "${env.JOB_NAME}#${env.BUILD_NUMBER} - ${buildStatus}" - def detail = """
${buildStatus}
Build | ${env.BUILD_URL} |