I have set some environment variables as below :
environment {
IMG_TARGET = "registry/cloud-environemnt-azu:1.x.x"
CREDENTIALS = 'credentials-token'
BUILD_DIR = 'Builddir'
DOMAIN_DIR = 'Domaindir'
BUILD_SOLUTION = 'Dir.Builddir.sln'
}
Some variables are used throughout the Jenkins pipeline and I am looking to separate them from environment variables, such that only credentials and image target are in environment variables.
Is there a way I can use global list/variable/map to store non-environment variables, like :
List<String> variables = [
BUILD_DIR = 'Builddir'
DOMAIN_DIR = 'Domaindir'
BUILD_SOLUTION = 'Dir.Builddir.sln'
]
If so, how can I refer a variable from this list? The variables are being referenced across multiple stages in the pipeline