You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2022/05/12 10:48:45 UTC

[uima-build-jenkins-shared-library] branch UIMA-6451-Jenkins-builds-should-run-against-multiple-platforms created (now 58c9fc1)

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

rec pushed a change to branch UIMA-6451-Jenkins-builds-should-run-against-multiple-platforms
in repository https://gitbox.apache.org/repos/asf/uima-build-jenkins-shared-library.git


      at 58c9fc1  [UIMA-6451] Jenkins builds should run against multiple platforms

This branch includes the following new commits:

     new 58c9fc1  [UIMA-6451] Jenkins builds should run against multiple platforms

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.



[uima-build-jenkins-shared-library] 01/01: [UIMA-6451] Jenkins builds should run against multiple platforms

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

rec pushed a commit to branch UIMA-6451-Jenkins-builds-should-run-against-multiple-platforms
in repository https://gitbox.apache.org/repos/asf/uima-build-jenkins-shared-library.git

commit 58c9fc1c3706c5f5f885aaf374d896a81206f55a
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu May 12 12:48:40 2022 +0200

    [UIMA-6451] Jenkins builds should run against multiple platforms
    
    - Added a matrix wrapper with two platforms, Windows and ubuntu - only deploy the SNAPSHOTs build from ubuntu
---
 vars/defaultPipeline.groovy | 147 ++++++++++++++++++++++++--------------------
 1 file changed, 80 insertions(+), 67 deletions(-)

diff --git a/vars/defaultPipeline.groovy b/vars/defaultPipeline.groovy
index 68a7f21..7f5f069 100644
--- a/vars/defaultPipeline.groovy
+++ b/vars/defaultPipeline.groovy
@@ -32,9 +32,7 @@ def call(body) {
         description: "Eligible agents (in case a build keeps running on a broken agent; overrides only current build)")
     }
 
-    agent {
-      label params.agentLabel ?: config.agentLabel
-    }
+    agent none
   
     tools {
       maven config.maven
@@ -52,86 +50,101 @@ def call(body) {
     }
       
     stages {
-      // Display information about the build environemnt. This can be useful for debugging
-      // build issues.
-      stage("Build info") {
-        steps {
-          echo '=== Environment variables ==='
-          script {
-            if (isUnix()) {
-              sh 'printenv'
-            }
-            else {
-              bat 'set'
-            }
+      matrix {
+        axes {
+          axis {
+              name 'PLATFORM'
+              values 'ubuntu', 'Windows'
           }
         }
-      }
-          
-      // Perform a merge request build. This is a conditional stage executed with the GitLab
-      // sources plugin triggers a build for a merge request. To avoid conflicts with other
-      // builds, this stage should not deploy artifacts to the Maven repository server and
-      // also not install them locally.
-      stage("Pull request build") {
-        when { branch 'PR-*' }
-      
-        steps {
-          script {
-            currentBuild.description = 'Triggered by: <a href="' + CHANGE_URL + '">' + BRANCH_NAME +
-              ': ' + env.CHANGE_BRANCH + '</a> (' +  env.CHANGE_AUTHOR_DISPLAY_NAME + ')'
-          }
-  
-          withMaven(maven: config.maven, jdk: config.jdk) {
+
+        agent {
+          label params.agentLabel ?: "(" + config.agentLabel + ") && ${PLATFORM}"
+        }
+         
+        // Display information about the build environemnt. This can be useful for debugging
+        // build issues.
+        stage("Build info") {
+          steps {
+            echo '=== Environment variables ==='
             script {
-              def mavenCommand = 'mvn ' +
-                  params.extraMavenArguments +
-                  ' -U -Dmaven.test.failure.ignore=true clean verify';
-                  
               if (isUnix()) {
-                sh script: mavenCommand
+                sh 'printenv'
               }
               else {
-                bat script: mavenCommand
+                bat 'set'
               }
             }
           }
-          
-          script {
-            def mavenConsoleIssues = scanForIssues tool: mavenConsole()
-            def javaIssues = scanForIssues tool: java()
-            def javaDocIssues = scanForIssues tool: javaDoc()
-            publishIssues issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
-          }
         }
-      }
-      
-      // Perform a SNAPSHOT build of a main branch. This stage is typically executed after a
-      // merge request has been merged. On success, it deploys the generated artifacts to the
-      // Maven repository server.
-      stage("SNAPSHOT build") {
-        when { branch pattern: "main|main-v2", comparator: "REGEXP" }
+            
+        // Perform a merge request build. This is a conditional stage executed with the GitLab
+        // sources plugin triggers a build for a merge request. To avoid conflicts with other
+        // builds, this stage should not deploy artifacts to the Maven repository server and
+        // also not install them locally.
+        stage("Pull request build") {
+          when { branch 'PR-*' }
         
-        steps {
-          withMaven(maven: config.maven, jdk: config.jdk) {
+          steps {
             script {
-              def mavenCommand = 'mvn ' +
-                params.extraMavenArguments +
-                ' -U -Dmaven.test.failure.ignore=true clean deploy'
-                
-              if (isUnix()) {
-                sh script: mavenCommand
-              }
-              else {
-                bat script: mavenCommand
+              currentBuild.description = 'Triggered by: <a href="' + CHANGE_URL + '">' + BRANCH_NAME +
+                ': ' + env.CHANGE_BRANCH + '</a> (' +  env.CHANGE_AUTHOR_DISPLAY_NAME + ')'
+            }
+    
+            withMaven(maven: config.maven, jdk: config.jdk) {
+              script {
+                def mavenCommand = 'mvn ' +
+                    params.extraMavenArguments +
+                    ' -U -Dmaven.test.failure.ignore=true clean verify';
+                    
+                if (isUnix()) {
+                  sh script: mavenCommand
+                }
+                else {
+                  bat script: mavenCommand
+                }
               }
             }
+            
+            script {
+              def mavenConsoleIssues = scanForIssues tool: mavenConsole()
+              def javaIssues = scanForIssues tool: java()
+              def javaDocIssues = scanForIssues tool: javaDoc()
+              publishIssues issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
+            }
           }
+        }
+        
+        // Perform a SNAPSHOT build of a main branch. This stage is typically executed after a
+        // merge request has been merged. On success, it deploys the generated artifacts to the
+        // Maven repository server.
+        stage("SNAPSHOT build") {
+          when { branch pattern: "main|main-v2", comparator: "REGEXP" }
           
-          script {
-            def mavenConsoleIssues = scanForIssues tool: mavenConsole()
-            def javaIssues = scanForIssues tool: java()
-            def javaDocIssues = scanForIssues tool: javaDoc()
-            publishIssues issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
+          steps {
+            withMaven(maven: config.maven, jdk: config.jdk) {
+              script {
+                def finalStep = PLATFORM == "ubuntu" ? "deploy" : "verify"
+                
+                def mavenCommand = 'mvn ' +
+                  params.extraMavenArguments +
+                  ' -U -Dmaven.test.failure.ignore=true clean deploy'
+                  
+                if (isUnix()) {
+                  sh script: mavenCommand
+                }
+                else {
+                  bat script: mavenCommand
+                }
+              }
+            }
+            
+            script {
+              def mavenConsoleIssues = scanForIssues tool: mavenConsole()
+              def javaIssues = scanForIssues tool: java()
+              def javaDocIssues = scanForIssues tool: javaDoc()
+              publishIssues issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
+            }
           }
         }
       }