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 {
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}'
}
}
}