mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Create Jenkinsfile
This commit is contained in:
parent
1ce845f40f
commit
88b623f375
1 changed files with 36 additions and 0 deletions
36
Jenkinsfile
vendored
Normal file
36
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
pipeline {
|
||||||
|
agent none
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
agent {
|
||||||
|
label 'builder'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
git clone https://github.com/KeraLLenarium/spring-petclinic.git
|
||||||
|
cd spring-petclinic
|
||||||
|
./mvnw spring-boot:build-image
|
||||||
|
docker tag spring-petclinic:3.3.0-SNAPSHOT kerallenarium/spring-petclinic
|
||||||
|
docker push kerallenarium/spring-petclinic
|
||||||
|
docker rmi -f $(docker images -q)
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh 'rm -rf spring-petclinic'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy') {
|
||||||
|
agent {
|
||||||
|
label 'production'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
docker pull kerallenarium/spring-petclinic:latest
|
||||||
|
docker run -d -p 80:8080 kerallenarium/spring-petclinic:latest
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue