From 9f6cc885e06343d0e2e21a6baa6abc1c4def23af Mon Sep 17 00:00:00 2001 From: BrahmanapallyNagaraju <44258487+BrahmanapallyNagaraju@users.noreply.github.com> Date: Wed, 8 Apr 2020 19:28:45 +0530 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bed4d6c39..ee95d660e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,21 +1,23 @@ pipeline { - agent any + agent {label "slave"} stages { stage("build") { steps { sh "pwd" sh "ls -lrtha" - sh "cd spring-petclinic" + dir("spring-petclinic") { sh "./mvnw package" + } } } stage("deploy") { steps { - sh "cd spring-petclinic" + dir("spring-petclinic") { sh """ docker build -t pet-clinic:1.0 . docker run -d -p 8080:8080 pet-clinic:1.0 """ + } } } }