So I have an environment in a Jenkins declarative pipeline script that looks something like this:
pipeline {
environment {
PATH1 = 'C:\Users\Administrator\Documents'
PATH2 = '${env.PATH1}\more_stuff'
}
// etc...
But when I try to access PATH2 in anything, it transcribes the literal "${env.PATH1}" into it rather that the environment variable PATH1.
I have tried ${env.PATH1}
, ${PATH1}
, %PATH1%
, but none of them work. How do I access environment variables while declaring other environment variables?
question from:
https://stackoverflow.com/questions/65836848/jenkins-acess-environment-variables-in-environment-declaration 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…