From 1058b0f36ed9eecdfe299777a59e7cdcdea857d8 Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Mon, 1 Oct 2018 16:26:42 +0200 Subject: [PATCH] Create Jenkinsfile (for Jenkins tool) --- Jenkinsfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..9f688284 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,48 @@ +pipeline { + + agent any + tools { + maven 'mvn-default' + jdk 'openjdk-8' + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + stages { + + stage('Cleaning') { + steps { + sh 'git clean -fdx' + } + } + + stage('Build') { + steps { + script { + if ( env.BRANCH_NAME ==~ /^release-[.0-9]+$/ ) { + sh 'mvn verify assembly:single' + } + else { + sh 'mvn verify site' + } + } + } + } + } + + post { + always { + archiveArtifacts artifacts: 'target/*.jar', fingerprint: true + script { + if ( env.BRANCH_NAME ==~ /^release-[.0-9]+$/ ) { + archiveArtifacts artifacts: 'target/*.zip', fingerprint: true + } + } + checkstyle pattern: 'target/checkstyle-result.xml' + junit 'target/surefire-reports/*.xml' + jacoco execPattern:'target/**.exec', classPattern: '**/classes', sourcePattern: '**/src/main/java' + } + } +} -- GitLab