added params to the jenkins file

This commit is contained in:
Venkatesh 2022-10-06 11:00:47 +05:30
parent c134cb9dc4
commit 07a2b55ea9

View file

@ -1,15 +1,19 @@
pipeline { pipeline {
agent { label 'JDK-11' } agent { label 'JDK-11' }
stages { 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') { stage('clone') {
steps { steps {
git url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git', git url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git',
branch: 'main' branch: '${params.BRANCH}'
} }
} }
stage('build') { stage('build') {
steps { steps {
sh 'mvn package' sh '${params.MAVEN_GOAL}'
} }
} }
} }