From: Olivier Lamy Date: Wed, 18 Apr 2018 04:02:22 +0000 (+1000) Subject: update Jenkinsfile X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=63f65c9f82c87386eb70dfedb41f1eb73258999f;p=archiva.git update Jenkinsfile --- diff --git a/Jenkinsfile b/Jenkinsfile index a585b5141..2468094d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,8 @@ -node { +node ("ubuntu") { // System Dependent Locations - def mvntool = tool name: 'maven3', type: 'hudson.tasks.Maven$MavenInstallation' + def mvntool = tool name: 'Maven 3.5.2', type: 'hudson.tasks.Maven$MavenInstallation' def jdktool = tool name: 'jdk8', type: 'hudson.model.JDK' + def deploySettings = 'DefaultMavenSettingsProvider.1331204114925' // Environment List mvnEnv = ["PATH+MVN=${mvntool}/bin", "PATH+JDK=${jdktool}/bin", "JAVA_HOME=${jdktool}/", "MAVEN_HOME=${mvntool}"] @@ -18,19 +19,26 @@ node { try { - stage 'Build' - withEnv(mvnEnv) { - timeout(60) { - // Run test phase / ignore test failures - sh "mvn -B clean install -Dmaven.test.failure.ignore=true" - // Report failures in the jenkins UI - step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) + stage ('Build') { + withEnv(mvnEnv) { + timeout(120) { + withMaven(maven: 'Maven 3.5.2', jdk: 'jdk8', + globalMavenSettingsConfig: deploySettings, + mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" + ) + { + // Run test phase / ignore test failures + sh "mvn -B clean deploy -Dmaven.test.failure.ignore=true" + } + // Report failures in the jenkins UI + //step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) + } + if(isUnstable()) + { + //notifyBuild("Unstable / Test Errors") + } } - if(isUnstable()) - { - //notifyBuild("Unstable / Test Errors") - } - } + } } catch(Exception e) { notifyBuild("Test Failure") throw e @@ -50,7 +58,7 @@ def notifyBuild(String buildStatus) // default the value buildStatus = buildStatus ?: "UNKNOWN" - def email = "${env.EMAILADDRESS}" + def email = "notifications@archiva.apache.org" def summary = "${env.JOB_NAME}#${env.BUILD_NUMBER} - ${buildStatus}" def detail = """

Job: ${env.JOB_NAME} [#${env.BUILD_NUMBER}]

${buildStatus}