I'm running this on my local machine's Jenkins installation. I tried this to now avail. The shell command fails since it can't find terrarom executable in /usr/local/bin
/usr/local/bin
node { withEnv(["PATH = /usr/local/bin:$env.PATH"]) { // The pipeline will fail it can't find terraform stage("Check terraform") { sh "terraform --version" } } }
In the documentation, there are no spaces around the = using withEnv.
=
withEnv
What you want is
node { withEnv(["PATH=/usr/local/bin:$env.PATH"]) { stage("Check terraform") { sh "terraform --version" } } }
1.4m articles
1.4m replys
5 comments
57.0k users