-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
Plugin 1.0
Presumably environment variable names must be legal Groovy identifiers (although generally, I don't think environment variables have as a strict a naming convention).
When trying to use various illegal identifiers, I got various different error messages:
pipeline {
agent any
stages {
stage('Foo') {
environment {
// Failure: Expected name=value pairs
3D_GLASSES = 'no'
// Failure: Expected name=value pairs
123ABC = 'bad'
// Failure: expecting token in range: '0'..'9', found 'X'
456_XYZ = 'numeric literal?'
// Failure: ((what - about) - hyphens) is a binary expression
what-about-hyphens = 'binary expression?'
// OK
LEGAL_GROOVY_IDENTIFIER = 'yay'
}
steps {
sh 'env'
}
}
}
}
I would expect some linting when editing the Pipeline (well, the editor does catch the 456_XYZ case), and nicer error messages at runtime.
- links to