You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2021/02/02 21:40:32 UTC

[myfaces] branch 2.3-next updated: Add jenkinsfile

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

bommel pushed a commit to branch 2.3-next
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.3-next by this push:
     new 56d500c  Add jenkinsfile
     new d57e277  Merge pull request #167 from volosied/2.3-next-jenkins
56d500c is described below

commit 56d500ccc1f2bbb10aa6aa9a7543d66611d03598
Author: Volodymyr Siedlecki <vo...@gmail.com>
AuthorDate: Tue Feb 2 16:26:51 2021 -0500

    Add jenkinsfile
---
 Jenkinsfile | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..1107edd
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,110 @@
+/*
+* 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 {
+        label 'ubuntu'
+    }
+
+    options {
+        buildDiscarder(logRotator(numToKeepStr: '5'))
+        timeout(time: 2, unit: 'HOURS')
+    }
+
+    triggers {
+        cron('@daily')
+        pollSCM('@hourly')
+    }
+
+    stages {
+        stage ('Build & Test') {
+            tools {
+                maven "maven_latest"
+                jdk "jdk_1.8_latest"
+            }
+            options {
+                timeout(time: 2, unit: 'HOURS')
+                retry(2)
+            }
+            steps {
+                sh 'mvn -V clean verify checkstyle:check apache-rat:check'
+            }
+            post {
+                always {
+                    junit '**/target/surefire-reports/*.xml'
+                    archiveArtifacts '**/target/*.jar'
+                }
+            }
+        }
+
+        stage('Deploy') {
+            tools {
+                maven "maven_latest"
+                jdk "jdk_1.8_latest"
+            }
+            steps {
+                sh "mvn clean deploy -Pgenerate-assembly"
+            }
+        }
+    }
+
+    post {
+        // Build Failed
+        failure {
+            mail to: "notifications@myfaces.apache.org",
+            subject: "Jenkins pipeline failed: ${currentBuild.fullDisplayName}",
+            body: 
+            """
+            Jenkins build URL: ${env.BUILD_URL}
+            The build for ${env.JOB_NAME} completed successfully and is back to normal.
+            Build: ${env.BUILD_URL}
+            Logs: ${env.BUILD_URL}console
+            Changes: ${env.BUILD_URL}changes
+            """
+        }
+
+        // Build succeeded, but some tests failed
+        unstable {
+            mail to: "notifications@myfaces.apache.org",
+            subject: "Jenkins pipeline failed: ${currentBuild.fullDisplayName}",
+            body: 
+            """
+            Jenkins build URL: ${env.BUILD_URL}
+            The build for ${env.JOB_NAME} completed successfully and is back to normal.
+            Build: ${env.BUILD_URL}
+            Logs: ${env.BUILD_URL}console
+            Changes: ${env.BUILD_URL}changes
+            """
+        }
+
+        // Last build failed, but current one was successful
+        fixed {
+            mail to: "notifications@myfaces.apache.org",
+            subject: "Jenkins pipeline is back to normal: ${currentBuild.fullDisplayName}",
+            body: 
+            """
+            Jenkins build URL: ${env.BUILD_URL}
+            The build for ${env.JOB_NAME} completed successfully and is back to normal.
+            Build: ${env.BUILD_URL}
+            Logs: ${env.BUILD_URL}console
+            Changes: ${env.BUILD_URL}changes
+            """
+        }
+    }
+}