Update Jenkinsfile

This commit is contained in:
BrahmanapallyNagaraju 2020-04-08 19:28:45 +05:30 committed by GitHub
parent 14c6784fd7
commit 9f6cc885e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

8
Jenkinsfile vendored
View file

@ -1,21 +1,23 @@
pipeline { pipeline {
agent any agent {label "slave"}
stages { stages {
stage("build") { stage("build") {
steps { steps {
sh "pwd" sh "pwd"
sh "ls -lrtha" sh "ls -lrtha"
sh "cd spring-petclinic" dir("spring-petclinic") {
sh "./mvnw package" sh "./mvnw package"
}
} }
} }
stage("deploy") { stage("deploy") {
steps { steps {
sh "cd spring-petclinic" dir("spring-petclinic") {
sh """ sh """
docker build -t pet-clinic:1.0 . docker build -t pet-clinic:1.0 .
docker run -d -p 8080:8080 pet-clinic:1.0 docker run -d -p 8080:8080 pet-clinic:1.0
""" """
}
} }
} }
} }