我有一個Jenkins管道腳本。別名沒有任何影響
在它,這個工程:
sh("/my/path/to/git status")
但是,如果我嘗試:
sh("alias git='/my/path/to/git' && git status")
OR
sh("alias git='/my/path/to/git'")
sh("git status")
這些不工作:script.sh: line 2: git: command not found
我想使第二和第三段代碼也可以工作。我怎樣才能做到這一點?