From 6323650bf4a2def116129bad7e293985fcd89012 Mon Sep 17 00:00:00 2001 From: krnv1 <41384439+krnv1@users.noreply.github.com> Date: Mon, 1 Aug 2022 20:19:14 -0700 Subject: [PATCH] Create Jenkinsfile21 --- Jenkinsfile21 | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Jenkinsfile21 diff --git a/Jenkinsfile21 b/Jenkinsfile21 new file mode 100644 index 0000000..170c280 --- /dev/null +++ b/Jenkinsfile21 @@ -0,0 +1,135 @@ +pipeline{ + + tools{ + jdk 'myjava' + maven 'mymaven' + } + agent any + + + + stages{ + + stage('Clone repo') + { + steps{ + + git 'https://github.com/Sonal0409/DevOpsCodeDemo.git' + + +} + + +} + +stage('Compile the code') + +{ + +steps{ + + +sh 'mvn compile' + + +} + + +} + + +stage('Code Review') + +{ + +steps{ + + +sh 'mvn pmd:pmd' + + +} + + +} + + + +stage('test the code') + +{ + +steps{ + +echo 'Testing' + +sh 'mvn test' + + + +} + + +post{ + + +success{ + +junit 'target/surefire-reports/*.xml' + +} + +} + +} + + +stage('Coverage of the code') + +{ + +steps{ + + +sh 'mvn cobertura:cobertura -Dcobertura.report.format=xml' + + + +} + + +post{ + + +success{ + +cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'target/site/cobertura/coverage.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false + +} + +} + +} + + + +stage('Package the code') + +{ + +steps{ + + +sh 'mvn package' + + +} + + +} + + +} + + +}