Basically, Im not able to alter the value in the path env variable. One way is to have a new field where in the user can pass the desired path value and then i pick that value and use it in my java files. But im sure there is a more elegant solution for this.
On Mon, 24 May, 2021, 20:42 yusuf zainee, <[email protected]> wrote: > Hi, > I'm facing a problem wrt the PATH env variable. > 1. In pipeline, i have a script, > pipeline { > > agent { > label 'master' > } > environment { > PATH="/usr/local/bin:$PATH" > } > stages { > stage ('build') { > steps { > echo "PATH=$PATH" > echo pwd() > echo "running crda analysis" > crdaAnalysis file:'<val>', crdaKeyId:'<val>', > cliVersion:'<val>' > echo "finished" > } > } > } > } > In the logs i can see > > *PATH=/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin* > but when i try to access the value in the step class and print > *System.getenv("PATH")*, i see > > *PATH:/sbin:/usr/sbin:/bin:/usr/bin* > > > 2. In the build step, I am facing the same problem. > > I tried setting the Path in the global env variable. Didnt work. > I tried to provide the value in the (execute shell), but when i try to view > the value of PATH in the plugin java class, i again see the same > *PATH:/sbin:/usr/sbin:/bin:/usr/bin* > > > Can someone please tell me whats going wrong here > > > Regards, > > Yusuf > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAHf8TqjgC3AjTg1G0syyCk%3DWp9YQ4FSKjp-PNa_kkd3Ui_X4ZQ%40mail.gmail.com.
