adding Jenkinsfile

This commit is contained in:
Mansi Boriya 2023-02-19 19:43:36 -08:00
parent 214d78da5e
commit 351210791e

22
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,22 @@
pipeline {
agent any
tools{
maven '3.9.0'
}
stages{
stage('Get Code and Build App'){
steps{
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/mansiboriya/spring-petclinic']])
sh 'docker build -t springpetclinic:test -f Dockerfile.test .'
sh 'docker run springpetclinic:test'
}
}
stage('Build docker image'){
steps{
script{
sh 'docker build -t springpetclinic:latest .'
}
}
}
}
}