Jenkins · Declarative pipeline basics
Ask for parameters
Add build parameters, which appear as a form when you run the job.
parameters {
string(name: 'VERSION', defaultValue: '1.0.0', description: 'Release version')
booleanParam(name: 'DEPLOY', defaultValue: false)
choice(name: 'ENV', choices: ['staging', 'production'])
}
Official Jenkins documentation
More declarative pipeline basics commands
- A minimal Jenkinsfile
- Run in a Docker container
- Set environment variables
- Set pipeline options
- Run on a schedule
- Run a stage conditionally
All declarative pipeline basics commands · Jenkins cheatsheet