In "Manage Jenkins" -> "Configure System" -> "Global properties", I added:
Name: git
Value: /path/to/my/git
and:
Name: PATH+git
Value: /path/to/my/git
However, if I try sh("git status")
from a Jenkins pipeline, I get:
git: command not found
While if I try with the full path sh("/path/to/my/git status")
, git is seen.
Any idea why git
is not seen in a Jenkins Pipeline Script after being declared as an environment variable?