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

All declarative pipeline basics commands · Jenkins cheatsheet

Was this page helpful?