Jenkins Global environment variables in Jenkinsfile

后端 未结 5 1124
深忆病人
深忆病人 2021-02-05 06:17

How do I invoke Global environment variables in Jenkinsfile?
For example, if I have a variable -

 name:credentialsId 
 value:xxxx-xxxx-xxxxx-xxxxxxxxx
         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 06:47

    For getting values all env.VAR, env['VAR'], env.getProperty('VAR') are fine.
    For setting values the only safe way at the moment is withEnv. If you try to assign values to env.VAR it may not work in some cases like for parallel pipelines (like in JENKINS-59871).

提交回复
热议问题