From fea262e7634232f5a896389d7cdda89e97fa3ed0 Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Sat, 9 Jan 2021 20:49:05 -0800 Subject: [PATCH] Updated jenkinsfile --- Jenkinsfile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d8e73968..c3a176b99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,15 +2,39 @@ pipeline { agent { 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 { - stage('Building our image') { + stage('build image') { steps { script { dockerImage = docker.build "mpatel011/spring-petclinic:$BUILD_NUMBER" } } } - stage('Deploy our image') { + stage('deploy image') { steps { script { docker.withRegistry('' , 'dockerhub') {