2012-10-05 2 views
1

Windows 7에서 Jenkins 1.484를 사용하고 있는데 git 저장소 복제에 문제가 있습니다.Windows 7에서 Jenkins와 함께 Git을 올바르게 구성하십시오.

올바르게 설정했지만 저장소를 복제하려고하면 영원히 성공하지 못합니다.

자식 --version 자식 버전 1.7.9.msysgit.0

내가 빌드를 중단 할 십분 후, 그건 경우, 내가 무엇을보고 :

ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:GBSA/Gottware-server.git 
hudson.plugins.git.GitException: Could not clone [email protected]:GBSA/Gottware-server.git 
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:271) 
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1040) 
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:982) 
    at hudson.FilePath.act(FilePath.java:851) 
    at hudson.FilePath.act(FilePath.java:824) 
    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:982) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1138) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494) 
    at hudson.model.Run.execute(Run.java:1502) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
    at hudson.model.ResourceController.execute(ResourceController.java:88) 
    at hudson.model.Executor.run(Executor.java:236) 
Caused by: hudson.plugins.git.GitException: Error performing command: C:\Program Files (x86)\Git\bin\git.exe clone --progress -o origin [email protected]:GBSA/Gottware-server.git G:\jenkins\workspaces\gottwareproductiontests 
    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:870) 
    at hudson.plugins.git.GitAPI.access$000(GitAPI.java:40) 
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:267) 
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:246) 
    at hudson.FilePath.act(FilePath.java:851) 
    at hudson.FilePath.act(FilePath.java:824) 
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:246) 
    ... 14 more 
Caused by: java.lang.InterruptedException 
    at java.lang.ProcessImpl.waitFor(Native Method) 
    at hudson.Proc$LocalProc.join(Proc.java:319) 
    at hudson.Launcher$ProcStarter.join(Launcher.java:352) 
    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:851) 
    ... 20 more 
Trying next repository 
ERROR: Could not clone repository 
FATAL: Could not clone 
hudson.plugins.git.GitException: Could not clone 
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1052) 
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:982) 
    at hudson.FilePath.act(FilePath.java:851) 

그냥 후 중단됩니다 그 반대의 경우 명령 줄에서 구성한 동일한 GIT를 실행하려고하면 복제가 성공합니다.

무슨 일입니까?

답변

4

Windows에서 Jenkins 프로세스는 SYSTEM 서비스로 실행되므로 계정을 사용하지 않고 SYSTEM 사용자로 실행됩니다. [email protected] 유형의 URL을 사용하고 있으므로 SSH를 사용하려고합니다. 이는 ssh 키를 미안과 같은 ssh 에이전트 또는 SYSTEM 사용자로 실행할 때 ~/.ssh/identity에서 찾을 수 있어야합니다.

가장 간단한 해결책은 http 또는 https 전송을 대신 사용하는 것입니다. 빌드를 수행 할 때 당기거나 밀지 않을 때이 프로토콜에 대한 사용자 이름 또는 암호를 구성 할 필요가 없습니다. 로컬 네트워크 구성에서 허용하는 경우 git 프로토콜 (git : //github.com/...)을 사용할 수 있습니다.

또는 sysinternals의 psexec를 사용하여 시스템 사용자로 명령 프롬프트를 표시하고 ssh가 작동하도록 로컬 환경을 수정할 수 있습니다. psexec -i -s cmd.exe은 SYSTEM 명령 프롬프트를 생성하고 msysGit bash 쉘을 실행하고 적절한 ssh 키를 설정하여 원격 시스템에 등록 할 수 있습니다. 나는 이것을 XP에서 사용 해왔다. 그래서 Win7에 더 이상 적용 할 수 없다. 다른 사용자 계정으로 실행되도록 Jenkins를 구성 할 수도 있지만 해당 방법을 로컬로 사용하지는 않았습니다.

+0

내 저장소가 비공개이며, http/https를 사용하는 이유는 무엇입니까? – Edmondo1984

+0

이제는 https 사용을 제외 할 수있는 정보를 추가했습니다. github 개인 저장소가 인증 된 https를 사용할 수 없다면. 그러나 오류는 리모컨에 액세스하기위한 자격 증명이없는 사용자로 빌드를 조작하고있는 경우가 대부분입니다. 어떻게 든 고쳐야하고 몇 가지 가능한 솔루션을 제공합니다. – patthoyts