Interview Prep/Jenkins/Declarative pipeline syntax

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.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax