您如何指定作为Jenkins一部分的Mercurial的身份验证信息? (mercurial_keyring) [英] How do you specify authentication information for Mercurial as part of Jenkins? (mercurial_keyring)

查看:99
本文介绍了您如何指定作为Jenkins一部分的Mercurial的身份验证信息? (mercurial_keyring)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将代码保存在Mercurial存储库中(通过自签名证书进行保护),并且我试图设置Jenkins来使用它.

I've got my code in a Mercurial repository (secured with a self-signed certificate) and I'm trying to set up Jenkins to work with it.

我已经在Jenkins中安装了Mercurial插件(指向在Jenkins Server/Slaves上安装了TortoiseHg),并且Jenkins Job已正确配置为从存储库中获取源代码.

I've got the Mercurial plugin installed in Jenkins (pointing to an install of TortoiseHg on the Jenkins Server/Slaves) and the Jenkins Job is properly configured to grab the source from the repository.

当我手动构建(即通过Web界面)时,一切都按预期工作.

When I build manually (ie, via the web interface) everything works as expected.

但是,由于我得到类似于以下内容的输出,似乎存储库的轮询未成功:

However, it seems like the polling of the repository does not succeed as I get output similar to the following:

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密钥环扩展一起使用以进行授权,但是基于错误输出,似乎并没有已应用.

I've previously done a manual clone of a repository so that I was able to enter the user's password to work with the Mercurial keyring extension for the authorization, but based on the error output it doesn't seem as though that's being applied.

如何配置Jenkins或运行构建的机器以成功进行轮询?

How can I configure Jenkins or the machine running the build to do the polling successfully?

推荐答案

这可能不是解决问题的最佳方法,但它对我有用,我可以继续.

This may not be the best way to address the issue, but it worked for me and I'm able to move on.

我能够弄清楚如何让服务器记住设置中的密码的唯一方法是在\ mercurial.ini中手动指定密码.

注意:您可能还必须从mercurial.ini中删除mercurial_keyring行. (由于我们是手动指定所有内容,因此会禁用密钥环扩展名.)

NOTE: You may also have to remove the mercurial_keyring line from mercurial.ini. (This disables the keyring extension since we're specifying everything manually.)

我以前曾经相信在服务器上克隆一次存储库会让它记住密码,但这似乎不适用于Jenkins的轮询功能(尽管在执行它们时确实可以与我的实际构建脚本一起使用)在服务器上).

I had previously believed that cloning a repository once on the server would let it remember the password, but this doesn't seem to work with the polling functionality in Jenkins (although it did work with my actual build scripts when they were executed on the server).

我对在服务器上以纯文本格式输入密码并不感到特别满意,但是直到找到一种更好的方法来使轮询工作时,我才能对此感到满意.

I'm not particularly pleased with having the password in plain text on the server, but until I find a better way to get the polling to work I can live with this.

这篇关于您如何指定作为Jenkins一部分的Mercurial的身份验证信息? (mercurial_keyring)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆