You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2019/08/31 17:02:20 UTC

[struts] 01/02: Defines a simple Docker build

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

lukaszlenart pushed a commit to branch docker-build
in repository https://gitbox.apache.org/repos/asf/struts.git

commit b524d26b57415ef32279a0b93b1a49ac86dbc72c
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Tue Aug 27 08:55:51 2019 +0200

    Defines a simple Docker build
---
 Jenkinsfile | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 7686d89..f361a00 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,28 +1,41 @@
 #!groovy
 pipeline {
   agent {
-    label 'ubuntu'
+    docker {
+      label 'ubuntu'
+      image 'maven:3-jdk-8'
+      args '-v $HOME/.m2:/root/.m2 -e MAVEN_OPTS="-Xmx1024m" -e USER=$USER'
+    }
   }
   options {
     buildDiscarder logRotator(daysToKeepStr: '14', numToKeepStr: '10')
     timeout(80)
     disableConcurrentBuilds()
   }
-  tools {
-    jdk 'JDK 1.8 (latest)'
-    maven 'Maven 3 (latest)'
-  }
   triggers {
     pollSCM 'H/15 * * * *'
   }
-  environment {
-    MAVEN_OPTS = '-Xmx1024m -XX:MaxPermSize=256m'
-  }
   stages {
+    stage('Maven version') {
+      steps {
+        sh 'mvn -v'
+      }
+    }
+
     stage('Build') {
       steps {
-        sh 'mvn --version'
-        sh 'mvn clean source:jar javadoc:jar install deploy -DskipWiki -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2'
+        sh 'mvn -B -DskipTests -DskipAssembly clean package'
+      }
+    }
+
+    stage('Test') {
+      steps {
+        sh 'mvn test'
+      }
+      post {
+        always {
+          junit '**/target/surefire-reports/*.xml'
+        }
       }
     }
   }