From 07a2b55ea926c2c1d40cd605e508ebe1de693cc6 Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Thu, 6 Oct 2022 11:00:47 +0530 Subject: [PATCH] added params to the jenkins file --- jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jenkinsfile b/jenkinsfile index c47bdb852..0d57b26a3 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -1,15 +1,19 @@ pipeline { agent { label 'JDK-11' } stages { + parameters { + string(name: 'MAVEN_GOAL', defaultValue: 'mvn package', description: 'enter maven goal') + choice(name: 'BRANCH', choices: ['master', 'main', 'three'], description: 'select one') + } stage('clone') { steps { git url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git', - branch: 'main' + branch: '${params.BRANCH}' } } stage('build') { steps { - sh 'mvn package' + sh '${params.MAVEN_GOAL}' } } }