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

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git


The following commit(s) were added to refs/heads/develop by this push:
     new 534a7f7f chore: Added a Jenkinsfile to configure the SNAPSHOT builds 
on Jenkins
534a7f7f is described below

commit 534a7f7f6c0091c8eee707012c4cf99d291fe78a
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Jan 4 10:01:47 2024 +0100

    chore: Added a Jenkinsfile to configure the SNAPSHOT builds on Jenkins
---
 Jenkinsfile | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README.md   |   2 +-
 jenkins.pom |  68 ++++++++++++++++++++++++
 pom.xml     |   2 +-
 4 files changed, 244 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 00000000..c7d6bec3
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,174 @@
+#!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 {
+            label 'ubuntu'
+        }
+    }
+
+    environment {
+        // Testfails will be handled by the jenkins junit steps and mark the 
build as unstable.
+        MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
+    }
+
+    tools {
+        maven 'maven_3_latest'
+        jdk 'jdk_11_latest'
+    }
+
+    options {
+        timeout(time: 1, unit: 'HOURS')
+        // When we have test-fails e.g. we don't need to run the remaining 
steps
+        skipStagesAfterUnstable()
+    }
+
+    stages {
+        stage('Initialization') {
+            steps {
+                echo 'Building Branch: ' + env.BRANCH_NAME
+                echo 'Using PATH = ' + env.PATH
+            }
+        }
+
+        stage('Checkout') {
+            steps {
+                echo 'Checking out branch ' + env.BRANCH_NAME
+                checkout scm
+            }
+        }
+
+        stage('Build and UT') {
+            when {
+                expression {
+                    env.BRANCH_NAME ==~ "(develop)|(rel/.*) |(jenkins-.*)"
+                }
+            }
+            steps {
+                echo 'Building and Unit Test...'
+                sh "mvn ${MVN_TEST_FAIL_IGNORE} clean install"
+            }
+            post {
+                always {
+                    junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
+                    junit(testResults: '**/failsafe-reports/*.xml', 
allowEmptyResults: true)
+                }
+            }
+        }
+
+        stage('Deploy Prepare') {
+            when {
+                expression {
+                    env.BRANCH_NAME ==~ "(develop)"
+                }
+            }
+            steps {
+                echo 'Deploy Prepare'
+                // We'll deploy to a relative directory so we can
+                // deploy new versions only if the entire build succeeds
+                sh "mvn -T 1C 
-DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir 
clean deploy -DskipTests"
+            }
+            post {
+                always {
+                    junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
+                    junit(testResults: '**/failsafe-reports/*.xml', 
allowEmptyResults: true)
+                }
+            }
+        }
+
+        stage('Deploy') {
+            when {
+                expression {
+                    env.BRANCH_NAME ==~ "(develop)"
+                }
+            }
+            steps {
+                echo 'Deploying'
+                // Deploy the artifacts using the wagon-maven-plugin.
+                sh 'mvn -f jenkins.pom -X -P deploy-snapshots wagon:upload -P 
get-jar-with-dependencies'
+            }
+        }
+
+        stage('Cleanup') {
+            steps {
+                echo 'Cleaning up the workspace'
+                deleteDir()
+            }
+        }
+    }
+
+    // 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]"
+                    )
+                }
+            }
+        }
+
+        // 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]"
+                    )
+                }
+            }
+        }
+
+        // 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]"
+                    )
+                }
+            }
+        }
+    }
+
+}
diff --git a/README.md b/README.md
index 6c77cf37..2a3878a5 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ ___________    ___________.__.__
 \__    ___/____\_   _____/|__|  |   ____  
   |    | /  ___/|    __)  |  |  | _/ __ \ 
   |    | \___ \ |     \   |  |  |_\  ___/ 
-  |____|/____  >\___  /   |__|____/\___  >  version 3.0.0
+  |____|/____  >\___  /   |__|____/\___  >  version 1.0.0
              \/     \/                 \/  
 </pre>
 
diff --git a/jenkins.pom b/jenkins.pom
new file mode 100644
index 00000000..097f6c82
--- /dev/null
+++ b/jenkins.pom
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>31</version>
+    </parent>
+
+    <groupId>org.apache.tsfile</groupId>
+    <artifactId>tsfile-jenkins-tools</artifactId>
+    <version>0.2.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>TsFile: Jenkins Tools</name>
+    <description>Set of helpers to do individual tasks only needed on our 
Jenkins build.</description>
+
+    <profiles>
+        <!--
+            This profile is used to deploy all the artifacts in the
+            'local-snapshots-dir' to Apache's SNAPSHOT repo.
+        -->
+        <profile>
+            <id>deploy-snapshots</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>wagon-maven-plugin</artifactId>
+                        <version>2.0.0</version>
+                        <configuration>
+                            
<fromDir>${project.basedir}/local-snapshots-dir</fromDir>
+                            <includes>**</includes>
+                            <excludes>library-udf</excludes>
+                            <serverId>apache.snapshots.https</serverId>
+                            <url>${distMgmtSnapshotsUrl}</url>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
diff --git a/pom.xml b/pom.xml
index 386b55d2..7518642d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache</groupId>
         <artifactId>apache</artifactId>
-        <version>30</version>
+        <version>31</version>
     </parent>
     <groupId>org.apache.tsfile</groupId>
     <artifactId>tsfile-parent</artifactId>

Reply via email to