diff --git a/JenkinsFile b/JenkinsFile new file mode 100644 index 000000000..88bf0be00 --- /dev/null +++ b/JenkinsFile @@ -0,0 +1,46 @@ +changesdonepipeline{ + tools{ + jdk 'myjava' + maven 'mymaven' + } + agent any + stages{ + stage('Checkout on git'){ + agent any + steps{ + git 'https://github.com/devops-trainer/DevOpsClassCodes.git' + } + } + stage('Compile'){ + agent any + steps{ + sh 'mvn compile' + } + } + stage('CodeReview'){ + agent any + steps{ + sh 'mvn pmd:pmd' + } + } + stage('UnitTest'){ + agent {label 'linux_slave'} + steps{ + git 'https://github.com/devops-trainer/DevOpsClassCodes.git' + sh 'mvn test' + } + } + stage('MetricCheck'){ + agent any + steps{ + sh 'mvn cobertura:cobertura -Dcobertura.report.format=xml' + } + } + stage('Package'){ + agent{label 'win_slave'} + steps{ + sh 'mvn package' + } + } + } +}