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/CAHf8Tqj%2B0j_%3DAveqsBzybGw78yeEGhCnMp2r_b1zA9DBeu0-NQ%40mail.gmail.com.

Reply via email to