2012-04-27 35 views
4

我已經在Mercurial存儲庫中獲取了我的代碼(使用自簽名證書進行了保護),並試圖設置Jenkins以使用它。作爲Jenkins的一部分,您如何爲Mercurial指定身份驗證信息? (mercurial_keyring)

我已經安裝了Jenkins中的Mercurial插件(指向Jenkins服務器/從站上的TortoiseHg的安裝),並且Jenkins作業已正確配置爲從存儲庫中獲取源代碼。

當我手動構建(即通過Web界面)時,一切都按預期工作。

然而,這似乎是倉庫的投票,因爲我得到類似以下的輸出不會成功:

Started on Apr 27, 2012 1:07:41 PM 
[<jobname>] $ hg pull --rev default 
warning: <MercurialServerIP> certificate with fingerprint e3:5f:5e:ea:4f:da:ef:a4:0b:4a:bb:00:e8:31:59:de:ce:d0:28:94 not verified (check hostfingerprints or web.cacerts config setting) 
abort: mercurial_keyring: http authorization required but program used in non-interactive mode 
[<jobname>] $ hg log --style <workspace>\<jobname>\tmp688470509422797505style --branch default --no-merges --prune 65d180b20a1e625841c8385709c86b83c3e10421 
Done. Took 1.9 sec 
No changes 

我以前做的一個倉庫的手工克隆,這樣我就能夠輸入用戶的密碼以與授權的Mercurial密鑰環擴展一起使用,但是基於錯誤輸出,似乎並不像應用那樣。

如何配置Jenkins或運行構建的機器以成功進行輪詢?

回答

3

這可能不是最好的方式來解決這個問題,但它對我有用,我可以繼續前進。

我能夠弄清楚如何讓服務器在我的設置中記住密碼的唯一方法是在\ mercurial.ini中手動指定它。

注意:您可能還必須從mercurial.ini中刪除mercurial_keyring行。 (由於我們手動指定了所有內容,因此這會禁用密鑰環擴展。)

我以前曾相信在服務器上克隆存儲庫一次就會讓它記住密碼,但這似乎不適用於輪詢功能在Jenkins中(儘管它在服務器上執行時與我的實際構建腳本一起工作)。

我對服務器上的純文本密碼不是特別滿意,但直到我找到更好的方式讓投票生效,我才能忍受這一點。

0

使用「kilnauth擴展」,你可以讓你的機器上存儲憑據。這樣你就不必在Jenkins上配置任何特別的東西。

$ hg help kilnauth 
kilnauth extension - stores authentication cookies for HTTP 
repositories. This extension knows how to capture Kiln 
authentication tokens when pushing over HTTP. 
This means you only need to enter your login and password once; 
after that, the FogBugz token will be stored in your home 
directory, allowing pushing without a password. 

有關如何安裝它的說明如下:http://kiln.stackexchange.com/questions/341/how-can-i-install-kilns-mercurial-extensions-manually

相關問題