From d2bd914fdc377e714b4c632655ecd7ce85571f36 Mon Sep 17 00:00:00 2001 From: JohnPaul Kambazza Date: Fri, 24 Jul 2020 22:31:10 -0400 Subject: [PATCH] Create jenkins_file --- jenkins_file | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 jenkins_file diff --git a/jenkins_file b/jenkins_file new file mode 100644 index 000000000..36ad3c117 --- /dev/null +++ b/jenkins_file @@ -0,0 +1,55 @@ +pipeline{ + tools{ + jdk 'myjava' + maven 'mymaven' + } + agent none + stages{ + stage('Compile'){ + agent any + steps{ + sh 'mvn compile' + } + + } + stage('CodeReview'){ + agent any + steps{ + sh 'mvn pmd:pmd' + } + post{ + always{ + pmd pattern: 'target/pmd.xml' + } + } + } + stage('UnitTest'){ + agent {label 'win_slave'} + steps{ + git 'https://github.com/devops-trainer/DevOpsClassCodes.git' + bat 'mvn test' + } + + } + stage('MetriCheck'){ + agent any + steps{ + sh 'mvn cobertura:cobertura -Dcobertura.report.format=xml' + } + post{ + always{ + cobertura coberturaReportFile: 'target/site/cobertura/coverage.xml' + } + } + } + stage('Package'){ + agent any + steps{ + sh 'mvn package' + } + } + + } + + } +