Skip to content
Permalink
Browse files
[JAMES-3226] Automatically publish staging doc (#11)
This enables building and publishing the antora documentation
automatically when the build of the master branche of james-project is
green.

Co-authored-by: Jean Helou <jhe@codamens.fr>
  • Loading branch information
chibenwa and jeantil committed Apr 7, 2021
1 parent 4811889 commit b94945499cdbc37120729d2173e8e4eb754a6337
Showing 1 changed file with 52 additions and 22 deletions.
@@ -28,8 +28,12 @@ pipeline {
label AGENT_LABEL
}

triggers {
upstream(upstreamProjects: '../ApacheJames/master', threshold: hudson.model.Result.SUCCESS)
}

environment {
CI=true
CI = true
}

tools {
@@ -88,17 +92,29 @@ pipeline {
failure {
echo "Failed "
script {
emailext(
subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
""",
to: "server-dev@james.apache.org",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
if (env.BRANCH_NAME == "live" || env.BRANCH_NAME == "staging") {
emailext(
subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
} else {
emailext(
subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
""",
recipientProviders: [[$class: 'RequesterRecipientProvider']]
)
}
}

}

// If this build didn't fail, but there were failing tests, send an email to the list.
@@ -110,17 +126,31 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
success {
echo "Success "
script {
if ((currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
emailext (
subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Is back to normal.
""",
to: "server-dev@james.apache.org",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
if (env.BRANCH_NAME == "live" || env.BRANCH_NAME == "staging") {

if ((currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
emailext(
subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Is back to normal.
""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
} else {
if ((currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
emailext(
subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
Is back to normal.
""",
recipientProviders: [[$class: 'RequesterRecipientProvider']]
)
}
}
}
}

0 comments on commit b949454

Please sign in to comment.