What parameter types are available in the `parameters` directive?
BeginnerConceptDeclarative pipeline syntax
Answer
parameters {
string(name: 'VERSION', defaultValue: '1.0.0', description: 'Release version')
text(name: 'NOTES', defaultValue: '')
booleanParam(name: 'RUN_E2E', defaultValue: false)
choice(name: 'ENV', choices: ['dev', 'staging', 'prod'])
password(name: 'TEMP_PASS', defaultValue: '')
}
Access with params.VERSION. Parameters defined in a Jenkinsfile only appear in the UI after the first run, because Jenkins must execute the file once to learn them.
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?IntermediateWhen do you use `agent none` at the top level?IntermediateHow do nested sequential stages work and why are they useful?IntermediateList the `post` conditions and when each fires.IntermediateWhat are the most useful `when` conditions?Intermediate