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 2020/08/02 15:27:55 UTC

[uima-uimafit] 01/01: [UIMA-6257] Jenkinsfile for uimaFIT

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

rec pushed a commit to branch UIMA-6257-Jenkinsfile-for-uimaFIT
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git

commit 5d78c431772ce2833adc2af5be1b708091aeaf5a
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Sun Aug 2 17:27:29 2020 +0200

    [UIMA-6257] Jenkinsfile for uimaFIT
    
    - Adding a basic Jenkinsfile
---
 Jenkinsfile | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..0874986
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,66 @@
+pipeline {
+  agent any
+  
+  options {
+    buildDiscarder(logRotator(
+      numToKeepStr: '25', 
+      artifactNumToKeepStr: '5'
+    ))
+    
+    // Seems not to be working reliably yet: https://issues.jenkins-ci.org/browse/JENKINS-48556
+    // timestamps()
+  }
+  
+  parameters {
+    string(
+      name: 'extraMavenArguments',
+      defaultValue: "",
+      description: "Extra arguments to be passed to maven (for testing)")
+  }
+
+  stages {
+    // Display information about the build environemnt. This can be useful for debugging
+    // build issues.
+    stage("Build info") {
+      steps {
+        sh 'printenv'
+      }
+    }
+        
+    // 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() {
+          sh script: 'mvn ' +
+            params.extraMavenArguments +
+            ' -U -Dmaven.test.failure.ignore=true clean verify'
+        }
+      }
+    }
+    
+    // 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: "master", comparator: "REGEXP" }
+      
+      steps {
+        withMaven() {
+          sh script: 'mvn ' +
+            params.extraMavenArguments +
+            ' -U -Dmaven.test.failure.ignore=true clean deploy'
+        }
+      }
+    }
+  }
+}