Skip to content

Commit

Permalink
Rename var in jenkinsfile
Browse files Browse the repository at this point in the history
deployableBranch is a better name chan supportedBranch
  • Loading branch information
bdemers committed May 7, 2021
1 parent bc7fa33 commit 2588375
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .jenkins.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

def supportedBranch = env.BRANCH_NAME ==~ /(1.7.x|1.8.x|main)/
def deployableBranch = env.BRANCH_NAME ==~ /(1.7.x|1.8.x|main)/

pipeline {

Expand Down Expand Up @@ -106,7 +106,7 @@ pipeline {
stage('Deploy') {
when {
allOf {
expression { supportedBranch }
expression { deployableBranch }
expression { MATRIX_JDK == 'jdk_11_latest' }
// is not a PR (GitHub) / MergeRequest (GitLab) / Change (Gerrit)?
not { changeRequest() }
Expand All @@ -125,7 +125,7 @@ pipeline {
// If this build failed, send an email to the list.
failure {
script {
if (supportedBranch) {
if (deployableBranch) {
emailext(
subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
Expand All @@ -142,7 +142,7 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
// If this build didn't fail, but there were failing tests, send an email to the list.
unstable {
script {
if (supportedBranch) {
if (deployableBranch) {
emailext(
subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
Expand All @@ -162,7 +162,7 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
// (in this cae we probably don't have to do any post-build analysis)
cleanWs()
script {
if (supportedBranch
if (deployableBranch
&& (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
emailext(
subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
Expand Down

0 comments on commit 2588375

Please sign in to comment.