Jenkins · Declarative pipeline basics
Set environment variables
Define variables for the whole pipeline or one stage.
environment {
NODE_ENV = 'production'
BUILD_TAG = "${env.JOB_NAME}-${env.BUILD_NUMBER}"
}
Official Jenkins documentation
More declarative pipeline basics commands
- A minimal Jenkinsfile
- Run in a Docker container
- Set pipeline options
- Ask for parameters
- Run on a schedule
- Run a stage conditionally
All declarative pipeline basics commands · Jenkins cheatsheet