I have an environment var with default value
RUN_TESTS= true
My Jenkins job contains two stages, build and test stage. The test stage modified to run 2 kind of tests sets depended on RUN_TESTS value.
RUN_TESTS value is set on build stage.
Is there a way to update value for environment variable for future use ?
Here what I tried without success
env.RUN_TESTS= true
node("node1"){
sh '''
printenv
RUN_TESTS="false"
'''
}
print RUN_TESTS
I am getting
+ RUN_TESTS=false
[Pipeline] }
[Pipeline] // node
[Pipeline] echo
true
[Pipeline] End of Pipeline