有人管理与 TeamCity、FinalBuilder 和 Mercurial (Kiln) 的持续集成吗?

发布于 2024-08-24 16:52:33 字数 466 浏览 8 评论 0原文

可能的重复:
Windows 上使用 Mercurial + Mercurial 队列的持续集成堆栈?

如果是这样,您的构建过程是什么样的?

我在让 TeamCity 运行我的 FinalBuilder 脚本方面遇到了困难(主要是因为我缺乏经验/对所有 3 个工具的理解)。现在,我有 FinalBuilder 管理所有源代码控制检查,而 TeamCity 基本上只是运行 FinalBuilder 脚本并读取 NUnit 测试结果,但由于在向 kiln 执行 Mercurial 命令时出现身份验证错误,它无法工作。

Possible Duplicate:
Continuous Integration stack on Windows with Mercurial + Mercurial Queues?

If so, what does your build process look like?

I'm having a difficult time (mostly because of my lack of experience/understanding of all 3 tools) getting TeamCity to run my FinalBuilder scripts. Right now I have FinalBuilder managing all the source control checkouts and TeamCity basically just running the FinalBuilder script and reading in the NUnit test results, but it doesn't work due to authentication errors while executing mercurial commands to kiln.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

美男兮 2024-08-31 16:52:33

如果您已在运行 FinalBuilder 脚本的计算机上安装了 Kiln 客户端,则您将可以访问“kilnauth”mercurial 扩展,该扩展应该可以为您解决此问题。

只需以运行 FinalBuilder 脚本的用户身份登录到构建计算机,然后从您尝试使用的 Mercurial 存储库手动执行一个推送或拉取命令,系统就会要求您进行身份验证。进行一次身份验证,Kiln 客户端扩展将记住该用户的此身份验证...并且 FinalBuilder 脚本的任何后续运行都应该可以很好地进行身份验证。

这能为您解决问题吗?这是最好的解决方案,因为它不会在您的计算机上存储任何用户名或密码。显然还有其他可能性,例如更改 Mercurial 的路径以使用格式 http://{username}:{password}@{kiln url}...但这并不像上面的技术那么好或安全。

这有道理吗?

If you've installed the Kiln Client on the machine running your FinalBuilder script, you'll have access to the "kilnauth" mercurial extension that should solve this problem for you.

Just log on to the build machine as the user that runs the FinalBuilder script and manually execute one push or pull command from the Mercurial repository you're trying to use, you'll be asked to authenticate. Authenticate once, and the Kiln Client extensions will remember this authentication for this user...and any subsequent runs by the FinalBuilder script should authenticate just fine.

Does this solve the problem for you? It's the best solution as it doesn't store any username or password on your machine. There are obviously other possibilities, like changing the path of your Mercurial to use the format http://{username}:{password}@{kiln url}...but this isn't as nice or safe as the technique above.

Does this make sense?

意中人 2024-08-31 16:52:33

我对 Kiln 一无所知,但我刚刚开始为 VSoft 工作,并且正在为 FinalBuilder 的下一版本开发 Mercurial 操作。希望其中一些会有所帮助。

您是通过 SSH 还是 SSL 进行身份验证?您可以从命令行拉/推到存储库吗?几乎所有可以通过命令行进行工作的内容都应该可以通过 FinalBuilder 实现。

要通过 SSH 对 BitBucket 进行身份验证,我执行了以下操作:

  • 下载 puttygen 和 pageant
  • 在 puttygen 中创建一个新的 SSH 密钥
  • 将私钥添加到 pageant
  • 将公钥添加到 BitBucket

从那里,我可以成功

hg push ssh://[email protected]/user/repo

NB,我还安装了 TortoiseHG,并且Mercurial 使用 TortoisePlink 作为 ssh 客户端。

如果您使用 SSL,则可以将用户名/密码组合存储在 FinalBuilder 操作中。要将 TextEdit 框转换为密码字段,请将 PasswordChar 属性从 #0 更改为 *。然后在 ReadData 事件中,添加类似内容

Page.tbPassword.Text = DecryptString(Properties.PropertyAsString("Token"));

,并在 WriteData 事件中,添加

Properties.PropertyAsString("Token") = EncryptString(Page.tbPassword.Text);

当您将 Token 属性添加到操作时,勾选 < code>“属性在操作检查器中隐藏” 和属性在操作检查器中为只读 选项。

要生成存储库字符串,您需要在操作的 GetCommandLine 事件中执行类似的操作:

var repo = Context.Properties.PropertyAsString("Repository");
var username = Context.Properties.PropertyAsString("Username");
var password = DecryptString(Context.Properties.PropertyAsString("Token"));
var repo = "ssh://" + username + ":" + password + "@" + repo;

CommandLine.AddArgument("push", repo, qtNone);

注意,我还没有测试该代码,但希望它能给您一个想法。

I don't know anything about Kiln, but I've just started working for VSoft and am working on a Mercurial action for the next version of FinalBuilder. Hopefully some of this will help.

Are you athenticating via SSH or SSL? Can you pull/push to the repository from the command line? Pretty much anything you can get to work from the command line should be possible with FinalBuilder.

To authenticate to BitBucket via SSH, I did the following:

  • download puttygen and pageant
  • create a new SSH key in puttygen
  • add the private key to pageant
  • add the public key to BitBucket

From there, I can successfully

hg push ssh://[email protected]/user/repo

NB, I also have TortoiseHG installed, and Mercurial is using TortoisePlink as the ssh client.

If you're using SSL, you can store the username/password combo in your FinalBuilder action. To turn a TextEdit box into a password field, change the PasswordChar property from #0 to *. Then in the ReadData event, add something like

Page.tbPassword.Text = DecryptString(Properties.PropertyAsString("Token"));

and in the WriteData event, add

Properties.PropertyAsString("Token") = EncryptString(Page.tbPassword.Text);

When you add the Token property to your action, tick the Property is Hidden from Action Inspector and Property is Read Only in Action Inspector options.

To generate your repository string, you'll want to do something like this in the Action's GetCommandLine event:

var repo = Context.Properties.PropertyAsString("Repository");
var username = Context.Properties.PropertyAsString("Username");
var password = DecryptString(Context.Properties.PropertyAsString("Token"));
var repo = "ssh://" + username + ":" + password + "@" + repo;

CommandLine.AddArgument("push", repo, qtNone);

NB, I haven't tested that code, but hopefully it gives you an idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文