2
我试图更新裸git回购作为生成的一部分。在Linux上它是相对简单的:如何直接在Windows上使用git与詹金斯ssh代理
dir("/my/git/repo.git") {
sshagent(['git']) {
sh "git fetch origin module:module"
}
}
但是我无法弄清楚如何在Windows上做到这一点。我想:
dir("c:\\my\\git\\repo.git") {
withEnv(["PATH=${env.PATH};C:\\Program Files\\Git\\usr\\bin"]) {
sshagent(['git']) {
sh "git fetch origin module:module"
}
}
}
但它失败:
Could not find ssh-agent: IOException: Cannot run program "ssh-agent": CreateProcess error=2, The system cannot find the file specified
Check if ssh-agent is installed and in PATH
我该怎么办呢?
谢谢。所以通过'withEnv'设置不起作用... –