You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2020/04/09 23:42:06 UTC

[tomcat-taglibs-parent] branch master updated: add Jenkinsfile

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

olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-parent.git


The following commit(s) were added to refs/heads/master by this push:
     new c83b7e5  add Jenkinsfile
c83b7e5 is described below

commit c83b7e511e41a9f9bdb412a99bb79a38e14d452b
Author: olivier lamy <ol...@apache.org>
AuthorDate: Fri Apr 10 09:41:54 2020 +1000

    add Jenkinsfile
    
    Signed-off-by: olivier lamy <ol...@apache.org>
---
 Jenkinsfile | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..e2b35ee
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,65 @@
+#!groovy
+
+pipeline {
+  agent any
+  options {
+    durabilityHint('PERFORMANCE_OPTIMIZED')
+    buildDiscarder(logRotator(numToKeepStr: '7', artifactNumToKeepStr: '2'))
+    timeout(time: 60, unit: 'MINUTES')
+  }
+  stages {
+    stage( "Parallel Stage" ) {
+      parallel {
+        stage( "Build / Test - JDK8" ) {
+          agent { node { label 'ubuntu' } }
+          options { timeout( time: 120, unit: 'MINUTES' ) }
+          steps {
+            mavenBuild( "jdk11", "clean install" )
+            script {
+              if (env.BRANCH_NAME == 'master') {
+                mavenBuild( "jdk8", "deploy" )
+              }
+            }
+          }
+        }
+        stage( "Build / Test - JDK11" ) {
+          agent { node { label 'ubuntu' } }
+          options { timeout( time: 120, unit: 'MINUTES' ) }
+          steps {
+            mavenBuild( "jdk11", "clean install" )
+          }
+        }
+      }
+    }
+  }
+}
+
+
+
+/**
+ * To other developers, if you are using this method above, please use the following syntax.
+ *
+ * mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
+ *
+ * @param jdk the jdk tool name (in jenkins) to use for this build
+ * @param cmdline the command line in "<profiles> <goals> <properties>"`format.
+ * @return the Jenkinsfile step representing a maven build
+ */
+def mavenBuild(jdk, cmdline) {
+  def mvnName = 'maven3'
+  //def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" // ".repository" //
+  //def settingsName = 'oss-settings.xml'
+  def mavenOpts = '-Xms2g -Xmx2g -Djava.awt.headless=true'
+
+  withMaven(
+          maven: mvnName,
+          jdk: "$jdk",
+          publisherStrategy: 'EXPLICIT',
+          globalMavenSettingsConfig: settingsName,
+          options: [junitPublisher(disabled: false)],
+          mavenOpts: mavenOpts,
+          mavenLocalRepo: localRepo) {
+    // Some common Maven command line + provided command line
+    sh "mvn -V -B -DfailIfNoTests=false -Dmaven.test.failure.ignore=true $cmdline"
+  }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org