This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch feature/SLING-7245
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git
The following commit(s) were added to refs/heads/feature/SLING-7245 by this
push:
new 45a8fb1 SLING-7245 - Validate pull requests using Jenkins
45a8fb1 is described below
commit 45a8fb1587365cf083ac4a28150830ebb35b149d
Author: Robert Munteanu <[email protected]>
AuthorDate: Tue Dec 18 00:06:06 2018 +0100
SLING-7245 - Validate pull requests using Jenkins
Switch to scripted pipeline for dynamic stage definition and
also use the 'withMaven' block for simpler configuration.
---
vars/slingOsgiBundleBuild.groovy | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)
diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 5a0721a..06ab27e 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -1,36 +1,20 @@
def call(Map params = [:]) {
def moduleDir = params.containsKey('moduleDir') ? params.moduleDir : '.'
-
- def overrides = readFile('.sling-module.xml')
- echo "Got overrides ${overrides}"
- def missingFile = readFile("blah")
- echo "Got missing file ${missingFile}"
- pipeline {
- agent {
- label 'ubuntu'
- }
+ node('ubuntu') {
- tools {
- maven 'Maven 3.3.9'
- jdk 'JDK 1.8 (latest)'
- }
+ checkout scm
- stages {
- stage ('Build') {
- steps {
- dir(moduleDir) {
- sh 'mvn clean install'
- }
- }
- }
+ stage('Init') {
+ def overrides = readFile('.sling-module.xml')
+ echo "Got overrides ${overrides}"
}
- post {
- always {
+ stage('Build') {
+ withMaven(maven: 'Maven 3.3.9', jdk: 'JDK 1.8 (latest)' ) {
dir(moduleDir) {
- junit allowEmptyResults: true, testResults:
'**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml'
- }
+ sh 'mvn clean install'
+ }
}
}
}