This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 393087d  Added a first version of a Jenkinsfile for build on Apache 
Infra
393087d is described below

commit 393087d7bdc9afa51dfb40bb251d1e00ffa51226
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Dec 20 10:47:15 2018 +0100

    Added a first version of a Jenkinsfile for build on Apache Infra
---
 Jenkinsfile | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..91affc7
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,118 @@
+#!groovy
+
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+pipeline {
+
+    agent {
+        node {
+            // Only "git-websites" nodes have the credentials to push to an 
"asf-site" branch of an ASF git repo.
+            label 'git-websites'
+        }
+    }
+
+    stages {
+        stage('Checkout') {
+            steps {
+                echo 'Checking out branch ' + env.BRANCH_NAME
+                checkout scm
+            }
+        }
+
+        stage('Build') {
+            when {
+              branch 'master'
+            }
+            steps {
+                echo 'Building'
+                sh 'npm run build'
+            }
+        }
+
+        stage('Deploy') {
+            when {
+              branch 'master'
+            }
+            steps {
+                echo 'Deploying'
+                // Deploy the artifacts using the wagon-maven-plugin.
+                //Commented out for now ...
+                //sh ''
+            }
+        }
+    }
+
+    // Send out notifications on unsuccessful builds.
+    post {
+        // If this build failed, send an email to the list.
+        failure {
+            script {
+                if(env.BRANCH_NAME == "master") {
+                    emailext(
+                        subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+                        body: """
+BUILD-FAILURE: 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: "[email protected]",
+                        recipientProviders: [[$class: 
'DevelopersRecipientProvider']]
+                    )
+                }
+            }
+        }
+
+        // If this build didn't fail, but there were failing tests, send an 
email to the list.
+        unstable {
+            script {
+                if(env.BRANCH_NAME == "master") {
+                    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: "[email protected]",
+                        recipientProviders: [[$class: 
'DevelopersRecipientProvider']]
+                    )
+                }
+            }
+        }
+
+        // Send an email, if the last build was not successful and this one is.
+        success {
+            script {
+                if ((env.BRANCH_NAME == "master") && 
(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: "[email protected]",
+                        recipientProviders: [[$class: 
'DevelopersRecipientProvider']]
+                    )
+                }
+            }
+        }
+    }
+
+}

Reply via email to