Added parameters
This commit is contained in:
29
013-parameters.groovy
Normal file
29
013-parameters.groovy
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
parameters {
|
||||||
|
string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
|
||||||
|
|
||||||
|
text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')
|
||||||
|
|
||||||
|
booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')
|
||||||
|
|
||||||
|
choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')
|
||||||
|
|
||||||
|
password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Example') {
|
||||||
|
steps {
|
||||||
|
echo "Hello ${params.PERSON}"
|
||||||
|
|
||||||
|
echo "Biography: ${params.BIOGRAPHY}"
|
||||||
|
|
||||||
|
echo "Toggle: ${params.TOGGLE}"
|
||||||
|
|
||||||
|
echo "Choice: ${params.CHOICE}"
|
||||||
|
|
||||||
|
echo "Password: ${params.PASSWORD}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user