在slave上是git clone ssh是可以成功的,但是jenkins调用slave节点就报如下错误:
ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not init XXXX Caused by: java.io.IOException: CreateProcess error=2, 系统找不到指定的文件。 at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 22 more ERROR: Error cloning remote repo 'origin' Finished: FAILURE
解决:需要在jenkins master上设置Tool Location,如下:
此外:首次下载,需要slave设置ssh-key 到gerrit上,并需要clone一次,选择主机信任。
1.ssh-keygen -t rsa -C test@163.com
2.cat ~/.ssh/id_rsa.pub
3.git config --global user.email "test@163.com"
4.git config --global user.name "test"
5.git config --global core.editor vim
6.git clone ssh:xxxxxxx