Source From Here
Question
How do I invoke Global environment variables in Jenkinsfile? For example, if I have a variable:
How do I use it in the groovy script?
How-To
In a Jenkinsfile, you have the "Working with the Environment" which mentions:
The syntax is ${env.xxx} as in:
See also "
Managing the Environment".
Check path as below:
See "Setting environment variables"
Question
How do I invoke Global environment variables in Jenkinsfile? For example, if I have a variable:
How do I use it in the groovy script?
How-To
In a Jenkinsfile, you have the "Working with the Environment" which mentions:
The syntax is ${env.xxx} as in:
- node {
- echo "Running ${env.BUILD_ID} on ${env.JENKINS_URL}"
- }
Check path as below:
See "Setting environment variables"
沒有留言:
張貼留言