2016-10-13 6 views
0

Я не могу клонировать git repostory в нашей локальной системе, используя плагин jenkins git. Я получаю следующую ошибку. Сначала я подумал, что это привилегия. Но, после изменения пользователя jenkins также, я получаю ту же ошибку. Ниже приведен консольный вывод, который я получил от дженкинсов:Невозможно клонировать локальный репозиторий git в Jenkins

Started by user Shibi 
Building in workspace /var/lib/jenkins/workspace/AMS-CLOUD 
Cloning the remote Git repository 
Cloning repository https://github.com/Atlonainc/AMS-Source-Code.git 
git init /var/lib/jenkins/workspace/AMS-CLOUD # timeout=10 
ERROR: Error cloning remote repo 'origin' 
hudson.plugins.git.GitException: Could not init /var/lib/jenkins/workspace/AMS-CLOUD 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:663) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:464) 
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1042) 
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082) 
at hudson.scm.SCM.checkout(SCM.java:495) 
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) 
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) 
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 
at hudson.model.Run.execute(Run.java:1720) 
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
at hudson.model.ResourceController.execute(ResourceController.java:98) 
at hudson.model.Executor.run(Executor.java:401) 
Caused by: hudson.plugins.git.GitException: Error performing command: git init /var/lib/jenkins/workspace/AMS-CLOUD 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1759) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1725) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1721) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1391) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:661)... 12 more 
Caused by: java.io.IOException: Cannot run program "git" (in directory "/var/lib/jenkins/workspace/AMS-CLOUD"): error=2, No such file or directory 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) 
at hudson.Proc$LocalProc.<init>(Proc.java:243) 
at hudson.Proc$LocalProc.<init>(Proc.java:212) 
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815) 
at hudson.Launcher$ProcStarter.start(Launcher.java:381) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1748) 
... 16 more 
Caused by: java.io.IOException: error=2, No such file or directory 
at java.lang.UNIXProcess.forkAndExec(Native Method) 
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186) 
at java.lang.ProcessImpl.start(ProcessImpl.java:130) 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) 
... 21 more`` 
ERROR: null 
Finished: FAILURE 

Пожалуйста, помогите мне с этой проблемой.

ответ

1

Перейти к Manage Jenkins -> Global Tool Configuration и под Git положить в полного пути (например: /usr/local/bin/git) к мерзавцу исполняемому на системе:

enter image description here

По умолчанию Path to Git executable предполагает, что git находится на пути , Из сообщения об ошибке в вашем сообщении, похоже, что это не относится к вам, так как исполняемый файл git не найден:

Caused by: java.io.IOException: Cannot run program "git" (in directory "/var/lib/jenkins/workspace/AMS-CLOUD"): error=2, No such file or directory 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) 

Caused by: java.io.IOException: error=2, No such file or directory 
+0

Большое спасибо Ashutosh Jindal. Он отлично работал – Shibiempire

Смежные вопросы