Jenkins as Windows Service; Mercurial.ini

335 views
Skip to first unread message

Andreas Schilling

unread,
Jul 17, 2012, 7:56:00 AM7/17/12
to jenkins...@googlegroups.com
hi everyone!

we're currrently setting up our new mercurial solution and are facing a problem getting the builds to run again.
our jenkins master is set up as windows service using the windows local system account.
where are we supposed to put the mercurial.ini with the credentials for the https access?
on the slave it works fine, but the slave service is run as another user, not the local system user. thus we simply put the .ini file into the user home as you can read in many tutorials and it worked.
we're not keen on simply changing the user our master runs on, because we're not sure what else it might affect.
has anyone ever straightened that out?
Btw, mercurial plugin version is 1.34.

kind regards and thanks for any help in advance,

Andreas Schilling
CAE Processes & Data Management
-------------------------------------------------------------------
Dipl. Inf. Andreas Schilling
Senior Software Architect

TWT GmbH
Science & Innovation
Bernhäuser Str. 40 - 42
73765 Neuhausen

Tel: +49 - 7158 - 17 15 - 673
E-Mail: andreas....@twt-gmbh.de
--------------------------------------------------------------------
www.twt-gmbh.de
--------------------------------------------------------------------
Geschäftsführung: Dimitrios Vartziotis, Joachim Laicher (stv.)
Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778
Umsatzsteuer: ID-Nr.: DE147841145
--------------------------------------------------------------------

Jesse Glick

unread,
Jul 17, 2012, 6:08:30 PM7/17/12
to jenkins...@googlegroups.com
On 07/17/2012 07:56 AM, Andreas Schilling wrote:
> our jenkins master is set up as windows service using the windows local system account.
> where are we supposed to put the mercurial.ini with the credentials for the https access?

hgrc(5) [1] gives a number of locations where Mercurial looks, or can be made to look, for config files.

You can also pass '--config section.key=value' as part of the Mercurial command, so defaults could be configured in the Mercurial installation your jobs use (see
$jenkins/configure). Of course this is less secure than storing credentials in a local file location; for example, the values will probably appear in build logs.

By the way if you are trying to use client certificates, rather than just a username/password combo, and get it to work, please update JENKINS-7351 [2] accordingly.

[1] http://www.selenic.com/mercurial/hgrc.5.html
[2] https://issues.jenkins-ci.org/browse/JENKINS-7351

Andreas Schilling

unread,
Jul 18, 2012, 3:09:11 AM7/18/12
to jenkins...@googlegroups.com
Hi Jesse,

all of the described locations didn't work for our case. We wanted to use the registry key, but for whatever reason this didn't work either.
Finally we used HGRCPATH environment variable which worked for us.
Unfortunately this is a pretty harsh override, so we had to additionally create the .hg/hgrc files in the hg installations (with the hgrc file being simply the default config from the installation with another name).

Thanks alot for the help!


Andreas Schilling
CAE Processes & Data Management
-------------------------------------------------------------------
Dipl. Inf. Andreas Schilling
Senior Software Architect

TWT GmbH
Science & Innovation
Bernhäuser Str. 40 - 42
73765 Neuhausen

Tel: +49 - 7158 - 17 15 - 673
E-Mail: andreas....@twt-gmbh.de
--------------------------------------------------------------------
www.twt-gmbh.de
--------------------------------------------------------------------
Geschäftsführung: Dimitrios Vartziotis, Joachim Laicher (stv.)
Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778
Umsatzsteuer: ID-Nr.: DE147841145
--------------------------------------------------------------------




Reply all
Reply to author
Forward
0 new messages