У меня есть экземпляр jenkins, к которому подключена подчиненная машина Windows. У меня также есть работа, которая находится в github, и у меня есть триггер - «Сборка, когда изменение передается в GitHub».
когда я вношу изменения в github, на jenkins не запускается сборка. Я проверяю и вижу, что полезная нагрузка действительно передается jenkins в «журнале ловушек Github», но я получаю следующую ошибку:
Started on Sep 18, 2014 3:57:06 PM
Using strategy: Default
[poll] Last Built Revision: Revision ce6a183e834a3e31afa0eb83a4418b0619c8642b (origin/master)
> "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master # timeout=10
FATAL: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:462)
at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357)
at hudson.scm.SCM.poll(SCM.java:374)
at hudson.model.AbstractProject._poll(AbstractProject.java:1428)
at hudson.model.AbstractProject.poll(AbstractProject.java:1331)
at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73)
at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:98)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1444)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1225)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1138)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1129)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2059)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:495)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:460)
... 13 more
Caused by: java.io.IOException: Cannot run program ""C:\Program Files (x86)\Git\cmd\git.exe"": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
at hudson.Launcher$ProcStarter.start(Launcher.java:360)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1433)
... 19 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:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 24 more
В основном жалуется на невозможность запустить команду C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
Но когда я вручную захожу на свою подчиненную машину и запускаю команду, она работает нормально.
Обратите внимание, что 1. Я сделал настройку, когда подчиненная служба jenkins входит в систему как администратор, чтобы у нее были все разрешения. 2. Мой сервер jenkins по умолчанию — это коробка Linux, а подчиненная машина — коробка Windows. Очевидно, что у обоих разные пути к исполняемому файлу git. Поэтому мне интересно, запускает ли Дженкинс эту команду по какой-то причине в моем Linux-боксе.
У меня есть настройка проекта для запуска только в ведомом окне Windows, и он отлично работает, поскольку он отлично строится (поэтому он может найти исполняемый файл git для задания)
Любые указатели?
Также кто-нибудь знает, как плагин github для jenkins работает с ведомыми машинами (ищет ли он git в ведомом устройстве или идет туда, где находится jenkins, поскольку это может быть источником, хотя понятия не имеет, какое решение для этого странного случая было бы быть?)