我在运行Windows 10的VM上安装了Jenkins。
我不知道如何,但事情进展顺利,但昨天事情停止了工作,这就是原因:
Started by user MyUser
Building in workspace C:\Program Files (x86)\Jenkins\jobs\MyProj\workspace
> C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/myuser/MyProj.git # timeout=10
Fetching upstream changes from https://github.com/myuser/MyProj.git
> C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_SSH to set credentials
FATAL: ssh executable not found. The git plugin only supports official git client http://git-scm.com/download/win
java.lang.RuntimeException: ssh executable not found. The git plugin only supports official git client http://git-scm.com/download/win
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getSSHExecutable(CliGitAPIImpl.java:1569)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.createWindowsGitSSH(CliGitAPIImpl.java:1575)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1305)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
所以SSH可执行文件存在问题......以前是否有人见过这个?
我被问及PATH
envvar,它没有设置为Jenkins文件夹和SSH文件夹,所以我做到了。我的PATH
指向:
PS C:\Users\myuser> echo $env:PATH
...;C:\Program Files\Git\cmd;C:\Program Files\Git\;C:\ProgramFiles\Git\usr\bin\;
文件夹C:\ProgramFiles\Git\usr\bin\
包含ssh.exe
。