Reputation: 2011
I have set a global jenkins env variable but for some reason my build is not picking system env variable. There is no error, but its not executing the if condition.
Pls point me where i'm wrong and how to use already set global system env variables in jenkins dsl.
Env variable set :
root@amp-jenkins-0:/var/jenkins_home/jobs# cat generator-job/builds/11/injectedEnvVars.txt | grep eks
kubernetes_cluster_name=xx-xxx
Upvotes: 0
Views: 568
Reputation: 2011
This worked for me
getBinding().getVariables()['kubernetes_cluster_name']
Upvotes: 0
Reputation: 1242
This should work
job('example') {
environmentVariables {
keepSystemVariables(true)
}
}
Description is here
Upvotes: 1