spring-petclinic/Jenkinsfile
Gurudatha D 24b4f90046
Update Jenkinsfile
chaged the fork git repo 

Signed-off-by: Gurudatha D <131242246+Guru911@users.noreply.github.com>
2026-02-10 20:03:02 +05:30

47 lines
762 B
Groovy

pipeline {
agent any
stages {
stage('Checkout') {
steps {
git 'https://github.com/Guru911/spring-petclinic.git'
}
}
stage('Build') {
steps {
sh 'mvn clean package -DskipTests'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('sonarqube') {
sh 'mvn sonar:sonar'
}
}
}
stage('Docker Build') {
steps {
sh 'docker build -t petclinic:1.0 .'
}
}
stage('Run Application') {
steps {
sh '''
docker rm -f petclinic || true
docker run -d -p 8081:8080 --name petclinic petclinic:1.0
'''
}
}
}
}