From 5aa98cf0207d34396d5dd7312aad079dc1a222c2 Mon Sep 17 00:00:00 2001 From: Guillem Hernandez Sola Date: Fri, 21 Sep 2018 12:57:13 +0200 Subject: [PATCH] Added new 011 simple maven --- 011-simple-maven-dev-func-pipeline.groovy | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 011-simple-maven-dev-func-pipeline.groovy diff --git a/011-simple-maven-dev-func-pipeline.groovy b/011-simple-maven-dev-func-pipeline.groovy new file mode 100644 index 0000000..32dbf1a --- /dev/null +++ b/011-simple-maven-dev-func-pipeline.groovy @@ -0,0 +1,47 @@ +pipeline { + agent any + stages { + stage('Checkout'){ + steps { + git 'https://bitbucket.org/itnove/simple-maven-spring-boot-example.git' + } + } + stage('Build') { + steps { + sh 'mvn -B -DskipTests clean package' + } + } + stage('Development Test') { + steps { + sh 'mvn -Dgroups=unit,integration test' + } + post { + always { + junit 'target/surefire-reports/*.xml' + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'target/surefire-reports', reportFiles: 'index.html', reportName: 'Development Test', reportTitles: '']) + } + } + } + stage('Deliver') { + steps { + sh './jenkins/scripts/deliver.sh' + } + } + stage('Functional Test') { + steps { + sh 'mvn -Dgroups=functional test' + } + post { + always { + junit 'target/surefire-reports/*.xml' + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'target/surefire-reports', reportFiles: 'index.html', reportName: 'Functional Test', reportTitles: '']) + } + } + } + } + post{ + success { + archiveArtifacts artifacts: 'target/hello-*.war', onlyIfSuccessful: true + } + } +}