3

I have a Jenkins instance with the Mercurial plugin installed on a Windows 2008 R2 machine. I am trying to define a build job for a Maven project on my KilnHQ repository. The HG clone step fails to retrieve code due to authentication failure.

I've read Kiln documentation and they only support HTTPS. There is no SSH support. However, the Jenkin's hg plugin does not allow me to enter a username/password.

How can I successfully wake my build work through Jenkins?

Danish
  • 3,708
  • 5
  • 29
  • 48

1 Answers1

3

With (all) http(s):// URLs it's legal to put the username and password directly in the URL. Mercurial supports that. If The Mercurial plugin for Jenkins doesn't break it then you can probably do that:

https://user:pass@kilnhost.com/path/to/repo

If that doesn't work you can probably put the authentication information in the Jenkin's user's home directory's Mercurial.ini file's [auth] section: http://www.selenic.com/mercurial/hgrc.5.html#auth

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
  • How would pass the username if it is an email address? i.e. with the character @ in it. – Danish Apr 16 '12 at 22:04
  • 1
    Heh, probably better to use the `[auth]` section then, but URL encoding the percent sign might do it. – Ry4an Brase Apr 17 '12 at 00:38
  • 1
    **IMPORTANT:** The solution is basically what @Ry4an mentioned. However, I would recommend downloading and installing kiln extensions and configuring them as outlined at http://kiln.stackexchange.com/questions/341/how-can-i-install-kilns-mercurial-extensions-manually . I also added `kiln.password` in the `[auth]` section for complete a seamless experience. – Danish Apr 19 '12 at 14:03
  • URL encoding the percent sign does work. Jenkins croaked on it when there are multiple @ symbols, so just make the first one %40. – Ian Robinson Aug 28 '12 at 22:47