You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2018/05/21 15:48:10 UTC

[maven] branch MNG-6364 updated (cdcb5f9 -> c904f5f)

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

hboutemy pushed a change to branch MNG-6364
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard cdcb5f9  created a function to run CoreITs and avoid copy/paste
     new c904f5f  created a function to run CoreITs and avoid copy/paste

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (cdcb5f9)
            \
             N -- N -- N   refs/heads/MNG-6364 (c904f5f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Jenkinsfile | 70 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 36 insertions(+), 34 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
hboutemy@apache.org.

[maven] 01/01: created a function to run CoreITs and avoid copy/paste

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-6364
in repository https://gitbox.apache.org/repos/asf/maven.git

commit c904f5f695f264e9a573885b8ac63c179d0d53b4
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Mon May 21 14:06:14 2018 +0200

    created a function to run CoreITs and avoid copy/paste
---
 Jenkinsfile | 175 +++++++++++++++++-------------------------------------------
 1 file changed, 49 insertions(+), 126 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 6e99928..2d89bc6 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -22,8 +22,11 @@ properties([buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: e
 def buildOs = 'linux'
 def buildJdk = '8'
 def buildMvn = '3.5.0'
+def runITsOses = ['linux', 'windows']
+def runITsJdks = ['7', '8', '9']
+def runITsMvn = '3.5.0'
+def runITscommand = "mvn clean install -Prun-its,embedded -B -U -V -Dmaven.test.failure.ignore=true" // -DmavenDistro=...
 def tests
-def CORE_IT_PROFILES='run-its,embedded'
 
 try {
 
@@ -59,137 +62,57 @@ node(jenkinsEnv.labelForOS(buildOs)) {
     }
 }
 
+Map runITsTasks = [:]
+for (String os in runITsOses) {
+    for (def jdk in runITsJdks) {
+        String osLabel = jenkinsEnv.labelForOS(os);
+        String jdkName = jenkinsEnv.jdkFromVersion(os, "${jdk}")
+        String mvnName = jenkinsEnv.mvnFromVersion(os, "${runITsMvn}")
+        echo "OS: ${os} JDK: ${jdk} => Label: ${osLabel} JDK: ${jdkName}"
 
-parallel linuxJava7:{
-        node(jenkinsEnv.labelForOS('linux')) {
-            stage ('Run ITs Linux Java 7') {
-                String jdkName = jenkinsEnv.jdkFromVersion('linux', '7')
-                String mvnName = jenkinsEnv.mvnFromVersion('linux', buildMvn)
-                dir('test') {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        sh "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
+        String stageId = "${os}-jdk${jdk}"
+        runITsTasks[stageId] = {
+            node(osLabel) {
+                stage("Run ITs ${os.capitalize()} Java ${jdk}") {
+                    if (!(os == 'windows')) {
+                        dir('test') {
+                            def WORK_DIR=pwd()
+                            checkout tests
+                            sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
+                            unstash 'dist'
+                            withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
+                                junitPublisher(ignoreAttachments: false)
+                            ]) {
+                                sh "${runITscommand} -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
+                            }
+                            deleteDir() // clean up after ourselves to reduce disk space
+                        }
+                    } else {
+                        // need a short path or we hit 256 character limit for paths
+                        // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent
+                        // will not trample each other
+                        dir("/mvn-it-${EXECUTOR_NUMBER}.tmp") {
+                            def WORK_DIR=pwd()
+                            checkout tests
+                            bat "if exist it-local-repo rmdir /s /q it-local-repo"
+                            bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip"
+                            unstash 'dist'
+                            withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
+                                junitPublisher(ignoreAttachments: false)
+                            ]) {
+                                bat "${runITscommand} -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
+                            }
+                            deleteDir() // clean up after ourselves to reduce disk space
+                        }
                     }
-                    deleteDir() // clean up after ourselves to reduce disk space
-                }
-            }
-        }
-    },linuxJava8: {
-        node(jenkinsEnv.labelForOS('linux')) {
-            stage ('Run ITs Linux Java 8') {
-                String jdkName = jenkinsEnv.jdkFromVersion('linux', '8')
-                String mvnName = jenkinsEnv.mvnFromVersion('linux', buildMvn)
-                dir('test') {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        sh "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
-                    }
-                    deleteDir() // clean up after ourselves to reduce disk space
-                }
-            }
-        }
-    },linuxJava9: {
-        node(jenkinsEnv.labelForOS('linux')) {
-            stage ('Linux Java 9') {
-                String jdkName = jenkinsEnv.jdkFromVersion('linux', '9')
-                String mvnName = jenkinsEnv.mvnFromVersion('linux', buildMvn)
-                dir('test') {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        sh "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
-                    }
-                    deleteDir() // clean up after ourselves to reduce disk space
-                }
-            }
-        }
-    }, winJava7: {
-        node(jenkinsEnv.labelForOS('windows')) {
-            stage ('Run ITs Windows Java 7') {
-                String jdkName = jenkinsEnv.jdkFromVersion('windows', '7')
-                String mvnName = jenkinsEnv.mvnFromVersion('windows', buildMvn)
-
-                // need a short path or we hit 256 character limit for paths
-                // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent
-                // will not trample each other
-                dir("/mvn-it-${EXECUTOR_NUMBER}.tmp") {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    bat "if exist it-local-repo rmdir /s /q it-local-repo"
-                    bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        bat "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
-                    }
-                    deleteDir() // clean up after ourselves to reduce disk space
-                }
-            }
-        }
-    }, winJava8: {
-        node(jenkinsEnv.labelForOS('windows')) {
-            stage ('Run ITs Windows Java 8') {
-                String jdkName = jenkinsEnv.jdkFromVersion('windows', '8')
-                String mvnName = jenkinsEnv.mvnFromVersion('windows', buildMvn)
-
-                // need a short path or we hit 256 character limit for paths
-                // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent
-                // will not trample each other
-                dir("/mvn-it-${EXECUTOR_NUMBER}.tmp") {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    bat "if exist it-local-repo rmdir /s /q it-local-repo"
-                    bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        bat "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
-                    }
-                    deleteDir() // clean up after ourselves to reduce disk space
-                }
-            }
-        }
-    }, winJava9: {
-        node(jenkinsEnv.labelForOS('windows')) {
-            stage ('Windows Java 9') {
-                String jdkName = jenkinsEnv.jdkFromVersion('windows', '9')
-                String mvnName = jenkinsEnv.mvnFromVersion('windows', buildMvn)
-
-                // need a short path or we hit 256 character limit for paths
-                // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent
-                // will not trample each other
-                dir("/mvn-it-${EXECUTOR_NUMBER}.tmp") {
-                    def WORK_DIR=pwd()
-                    checkout tests
-                    bat "if exist it-local-repo rmdir /s /q it-local-repo"
-                    bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip"
-                    unstash 'dist'
-                    withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
-                        junitPublisher(ignoreAttachments: false)
-                    ]) {
-                        bat "mvn clean install -P$CORE_IT_PROFILES -B -U -V -Dmaven.test.failure.ignore=true -DmavenDistro=$WORK_DIR/apache-maven-dist.zip"
-                    }
-                    deleteDir() // clean up after ourselves to reduce disk space
                 }
             }
         }
     }
+}
+
+// run the parallel ITs
+parallel(runITsTasks)
 
 // JENKINS-34376 seems to make it hard to detect the aborted builds
 } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {

-- 
To stop receiving notification emails like this one, please contact
hboutemy@apache.org.