From f5eea344bd54b8fd1c22f0b6b2e6078a42cf557c Mon Sep 17 00:00:00 2001 From: PRIYANSH VAISHNAV <97830704+Priyanshvaishnav@users.noreply.github.com> Date: Tue, 21 May 2024 12:57:53 +0530 Subject: [PATCH] Create Jenkinsfile --- Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..cdb3eaf5d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,39 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + git 'https://github.com/spring-projects/spring-petclinic.git' + } + } + + stage('Build') { + steps { + // Using Maven to build the project + sh './mvnw clean install' + } + } + + stage('Test') { + steps { + // Run tests + sh './mvnw test' + } + } + + stage('Package') { + steps { + // Package the application + sh './mvnw package' + } + } + } + + post { + always { + archiveArtifacts artifacts: 'target/*.jar', allowEmptyArchive: true + junit 'target/surefire-reports/*.xml' + } + } +}