Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JAMES-3226] Automatically publish staging doc #4

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
86 changes: 60 additions & 26 deletions Jenkinsfile
Expand Up @@ -19,14 +19,18 @@
*/

def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu'
def JDK_NAME = env.JDK_NAME ?: 'JDK 11 (latest)'
def MAVEN_NAME = 'Maven 3 (latest)'
def JDK_NAME = env.JDK_NAME ?: 'jdk_11_latest'
def MAVEN_NAME = 'maven_3_latest'

pipeline {

agent {
label AGENT_LABEL
}

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

environment {
CI=true
Expand Down Expand Up @@ -86,19 +90,34 @@ pipeline {
post {
// If this build failed, send an email to the list.
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") {
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>"
""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
}else{
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>"
""",
recipientProviders: [[$class: 'RequesterRecipientProvider']]
)
}
}

}

// If this build didn't fail, but there were failing tests, send an email to the list.
Expand All @@ -109,18 +128,33 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
// Send an email, if the last build was not successful and this one is.
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") {
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.
""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
}
}else{
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.
""",
recipientProviders: [[$class: 'RequesterRecipientProvider']]
)
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions README.adoc
Expand Up @@ -9,3 +9,6 @@ This repository is used for storing (some) content for https://james.apache.org[
It's also used to build and publish the website.

Please see https://james.apache.org/james-site/latest/index.html[online documentation website] or the `docs/` folder.

IMPORTANT: The website must not be published as Apache Source files.
The reason is the antora ui-bundle uses MPL 2.0 license and we can't mix it with ASF 2.0 https://issues.apache.org/jira/browse/LEGAL-530 .
2 changes: 1 addition & 1 deletion doc-sites/antora-playbook-local.yml
Expand Up @@ -5,7 +5,7 @@
site:
title: Apache James
url: https://james.apache.org/
start_page: main::index.adoc
start_page: james-site::homepage.adoc
content:
sources:
- url: ./../../james-hupa
Expand Down
14 changes: 7 additions & 7 deletions doc-sites/antora-playbook.yml
Expand Up @@ -4,31 +4,31 @@ site:
start_page: james-site::homepage.adoc
content:
sources:
- url: https://gitbox.apache.org/repos/asf/james-hupa.git
- url: https://github.com/apache/james-hupa.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-jdkim.git
- url: https://github.com/apache/james-jdkim.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-jsieve.git
- url: https://github.com/apache/james-jsieve.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-jspf.git
- url: https://github.com/apache/james-jspf.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-mime4j.git
- url: https://github.com/apache/james-mime4j.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-project.git
- url: https://github.com/apache/james-project.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
- url: https://gitbox.apache.org/repos/asf/james-postage.git
- url: https://github.com/apache/james-postage.git
branches: master
start_path: docs
edit_url: '{web_url}/blob/{refname}/{path}'
Expand Down