2013-11-01 61 views
5

我無法讓詹金斯識別我的git repo。截圖如下。我被告知使用git clone https://blah/blah.git將克隆回購作爲只讀而不需要憑據或密鑰。我想拉取代碼並構建它。如何讓詹金斯連接到git存儲庫

有趣的是,當我從命令行執行相同的命令,它的工作原理和文件從回購中被拉下來。

export GIT_SSL_NO_VERIFY=true 
git clone https://blah.com:8443/blah.git 

當我進入詹金斯URL和環境變量,它說,它無法連接到存儲庫。有沒有人知道我可能需要做些什麼才能使它起作用?在此先感謝您的幫助。

enter image description here

UPDATE /澄清:詹金斯安裝是下一個服務帳戶,不涉及到公司內部的任何用戶。

UPDATE#2: 這裏是控制檯輸出。我有一點消毒,所以我道歉,如果我錯過了什麼。

Started by user anonymous 
Building in workspace /home/hduser/.jenkins/workspace/analytics 
Fetching changes from the remote Git repository 
Fetching upstream changes from https://blah.com:8443/blah.git 
FATAL: Failed to fetch from https://blah.com:8443/blah.gitt 
hudson.plugins.git.GitException: Failed to fetch from https://blah.com:8443/blah.git 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612) 
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1411) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)  
    at hudson.model.Run.execute(Run.java:1665) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
    at hudson.model.ResourceController.execute(ResourceController.java:88) 
    at hudson.model.Executor.run(Executor.java:246) 
Caused by: hudson.plugins.git.GitException: Failed to connect to https://blah.com:8443/blah.git 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:167) 
    at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229) 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610) 
    ... 10 more 
+0

你可以發佈jenkins日誌嗎? – Nathan

+0

通過「從命令行執行相同的命令」我假設你的意思是'curl https://blah.com:8443/proj.git'? –

+0

@Nathan當你說詹金斯日誌,我假設你是指工作的建立日誌? – Classified

回答

0

感謝大家的建議,意見和幫助。我認爲這是一個插件問題。其他人也經歷了我做過的同樣的事情(original post here)。如果我從命令行運行該命令,或者如果我在Jenkins中輸入命令Build> Execute shell> Command,它可以正常工作。

我有Git客戶端插件= 1.4.3和Git插件1.5.0。我會等待看看是否有更新的插件修復此問題。

+0

是否嘗試過[git插件主頁]中提到的建議(https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin)(請參閱「疑難解答」),告訴您使用完全合格的路徑爲git可執行文件? – eis

+0

另外,你可以測試'-Dorg.jenkinsci.plugins.gitclient.Git.useCLI = false',就像你的建議在同一頁 – eis

+0

thx中提出的那樣。是的,「陷阱」沒有幫助。我升級了插件,但仍然失敗,但現在它是一個不同的信息。我還沒有嘗試你的第二評論,但我會在一秒鐘內嘗試。我可能會再次降級我的插件以獲得與以前相同的條件。希望它工作 – Classified