You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2021/07/06 15:25:17 UTC

[jackrabbit-oak] branch trunk updated: OAK-9486: Build all modules on GitHub PR

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

mreutegg pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2870028  OAK-9486: Build all modules on GitHub PR
     new f854744  Merge pull request #315 from mreutegg/OAK-9486-1
2870028 is described below

commit 28700284e449907d5373ce9241459d91ede4a4ce
Author: Marcel Reutegger <ma...@gmail.com>
AuthorDate: Tue Jul 6 15:40:31 2021 +0200

    OAK-9486: Build all modules on GitHub PR
    
    Initial commit with just a single module for now (oak-commons)
---
 Jenkinsfile | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..6431afd
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,78 @@
+#!/usr/bin/env 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.
+ */
+
+// schedule oak-jcr:ut,oak-search-elastic,oak-segment-tar,oak-store-document first
+// because they are longest running modules
+// def OAK_MODULES = 'oak-jcr:ut,oak-search-elastic,oak-segment-tar,oak-store-document,oak-api,oak-auth-external,oak-auth-ldap,oak-authorization-cug,oak-authorization-principalbased,oak-benchmarks,oak-benchmarks-elastic,oak-benchmarks-lucene,oak-benchmarks-solr,oak-blob,oak-blob-cloud,oak-blob-cloud-azure,oak-blob-plugins,oak-commons,oak-core,oak-core-spi,oak-examples,oak-exercise,oak-http,oak-it,oak-it-osgi,oak-jackrabbit-api,oak-jcr:it,oak-lucene,oak-pojosr,oak-query-spi,oak-run,oak-ru [...]
+def OAK_MODULES = 'oak-commons'
+
+properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10'))])
+
+def buildModule(moduleSpec) {
+    def moduleName = ''
+    def testOptions = '-PintegrationTesting'
+    def idx = moduleSpec.indexOf(':') 
+    if (idx == -1) {
+        moduleName = moduleSpec
+    } else {
+        moduleName = moduleSpec.substring(0, idx)
+        flags = moduleSpec.substring(idx + 1)
+        if (flags == 'ut') {
+            // unit tests only
+            testOptions = '' 
+        } else if (flags == 'it') {
+            // integration tests only
+            testOptions = '-PintegrationTesting -Dsurefire.skip.ut=true' 
+        }
+    }
+    stage(moduleSpec) {
+        node(label: 'ubuntu') {
+            def JAVA_JDK_8=tool name: 'jdk_1.8_latest', type: 'hudson.model.JDK'
+            def MAVEN_3_LATEST=tool name: 'maven_3_latest', type: 'hudson.tasks.Maven$MavenInstallation'
+            def MAVEN_CMD = "mvn --batch-mode -Dmaven.repo.local=${env.HOME}/maven-repositories/${env.EXECUTOR_NUMBER}"
+            timeout(60) {
+                checkout scm
+                withEnv(["Path+JDK=$JAVA_JDK_8/bin","Path+MAVEN=$MAVEN_3_LATEST/bin","JAVA_HOME=$JAVA_JDK_8"]) {
+                    // clean all modules
+                    sh "${MAVEN_CMD} -T 1C clean"
+                    // build and install up to desired module
+                    sh "${MAVEN_CMD} -Dbaseline.skip=true -Prat -T 1C install -DskipTests -pl :${moduleName} -am"
+                    try {
+                        sh "${MAVEN_CMD} ${testOptions} -DtrimStackTrace=false -Dnsfixtures=SEGMENT_TAR,DOCUMENT_NS clean verify -pl :${moduleName}"
+                    } finally {
+                        archiveArtifacts(artifacts: '*/target/unit-tests.log', allowEmptyArchive: true)
+                        junit(testResults: '*/target/surefire-reports/*.xml,*/target/failsafe-reports/*.xml', allowEmptyResults: true)
+                    }
+                }
+            }
+        }
+    }
+}
+
+def stagesFor(modules) {
+    def stages = [:]
+    for (m in modules.tokenize(',')) {
+        def module = m.trim()
+        stages[module] = { buildModule(module) }
+    }
+    return stages
+}
+
+parallel stagesFor("${OAK_MODULES}")