Updated jenkinsfile

This commit is contained in:
Maharshi Patel 2021-01-09 20:49:05 -08:00
parent 88530113e8
commit fea262e763

28
Jenkinsfile vendored
View file

@ -2,15 +2,39 @@ pipeline {
agent { agent {
label 'dockerbuild' label 'dockerbuild'
} }
/////////////////////////////////////////////////////////////////////
// START :
// Definition of Jenkins job configuration
// Job Parameters and any other config is set here, not in Jenkins UI
/////////////////////////////////////////////////////////////////////
options {
disableConcurrentBuilds()//Do NOT run in parallel!
buildDiscarder(logRotator(numToKeepStr: '50'))
timeout(time: 120, unit: 'MINUTES')
skipStagesAfterUnstable()
timestamps()
}
environment {
artifactory_url="https://petclinic.jfrog.io/artifactory"
artifactory_repo="spring-petclinic"
}
/////////////////////////////////////////////////////////////////////
// END
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// START : Stages
/////////////////////////////////////////////////////////////////////
stages { stages {
stage('Building our image') { stage('build image') {
steps { steps {
script { script {
dockerImage = docker.build "mpatel011/spring-petclinic:$BUILD_NUMBER" dockerImage = docker.build "mpatel011/spring-petclinic:$BUILD_NUMBER"
} }
} }
} }
stage('Deploy our image') { stage('deploy image') {
steps { steps {
script { script {
docker.withRegistry('' , 'dockerhub') { docker.withRegistry('' , 'dockerhub') {