From 6a4ff14e419f8a7a6f4eea4e65bf67a706899689 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Lopez Date: Thu, 3 Feb 2022 12:10:55 +0100 Subject: [PATCH] updating simple maven project --- templates/simple-java-maven-app/Jenkinsfile | 37 +++++++-------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/templates/simple-java-maven-app/Jenkinsfile b/templates/simple-java-maven-app/Jenkinsfile index 0551116..1bcd90d 100644 --- a/templates/simple-java-maven-app/Jenkinsfile +++ b/templates/simple-java-maven-app/Jenkinsfile @@ -1,5 +1,11 @@ pipeline { - agent any + + agent { + kubernetes { + label 'maven' + defaultContainer 'maven' + } + } stages { stage('Checkout') { @@ -15,28 +21,9 @@ pipeline { } post { - - // Email Ext plugin: - success { - - emailext ( - subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: """

SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':

-

Check console output at "${env.JOB_NAME} [${env.BUILD_NUMBER}]"

""", - to: "${emailRecipient}", - from: "buildNotifications@emailaddress.com" - ) - } - - failure { - - emailext ( - subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: """

FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':

-

Check console output at "${env.JOB_NAME} [${env.BUILD_NUMBER}]"

""", - to: "${emailRecipient}", - from: "buildNotifications@emailaddress.com" - ) - } + success { + junit 'target/surefire-reports/**/*.xml' + } + } } -} \ No newline at end of file +}