diff --git a/013-parameters.groovy b/013-parameters.groovy new file mode 100644 index 0000000..17e106f --- /dev/null +++ b/013-parameters.groovy @@ -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}" + } + } + } +} \ No newline at end of file