-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
I would like to keep track of BRANCH within pipeline and build certain stages for certain branches. For this purpose I defined a variable TEST_BRANCH='develop', but I get error :
groovy.lang.MissingPropertyException: No such property: TEST_BRANCH for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
I thought I am not allowed to start variable name with TEST so I renamed the variable to BRANCH_TEST but I am still getting the same error. Can someone please clarify if there are any restriction on naming variables inside the environment section of pipeline.
pipeline
{
agent any
environment //Used within the pipeline
{ GIT_COMMIT = '' GIT_PROJECT = 'abc' GIT_REPO = 'repo1' APP_NAME = 'repo1' SERVER_NAME = 'xyz-web' GIT_BRANCH = env.BRANCH_NAME ?: 'develop' BRANCH_TEST = 'develop' ... }...
}
- links to