diff --git a/jenkinfile b/jenkinfile new file mode 100644 index 000000000..820647fc9 --- /dev/null +++ b/jenkinfile @@ -0,0 +1,34 @@ +pipeline { + agent any + tools { + maven 'Maven' // Ensure Maven is installed in Jenkins + } + stages { + stage('Clone the project') { + steps { + git branch: 'main', url: 'https://github.com/pranavi-23/spring-petclinic.git' + } + } + + stage('Build the project') { + steps { + sh 'mvn clean install' + } + } + stage('Test') { + steps { + sh 'mvn test' + } + } + stage('Publish the Test results') { + steps { + junit 'target/surefire-reports/*.xml' + } + } + stage('Publish the artifacts results') { + steps { + archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false + } + } + } +} \ No newline at end of file