How do I configure global Mercurial options (like extensions) in Cloudbees Jenkins?

304 views Asked by At

I have a Cloudbees Jenkins instance configured to build several Mercurial projects. I would like to configure global Mercurial options that would normally go in ~/.hgrc, such as:

[extensions]
eol =

When setting up my own standalone Jenkins instance, I normally just log in as the user running Jenkins and set up its environment.

For Cloudbees, it's not clear how I should handle this. I don't see a way to configure the Mercurial Jenkins plugin to use a specific configuration file. Even if I could do that, I'm not sure where or when to fill in that file.

Can I somehow create a ~/.hgrc that applies to my entire Cloudbees Jenkins instance? Or do I need to do this on a per-job basis? I might be able to set up HGRCPATH in a pre-build step via EnvInect, or maybe modify the project .hgrc via a script build action. However, it seems like neither of these would necessarily happen early enough in the build process to take effect when the job starts.

I feel like I'm missing something obvious. Can someone suggest the proper way to accomplish this?

1

There are 1 answers

4
Jesse Glick On

Go to the system configuration page and create a new Mercurial installation. Leave Installation directory blank and set Executable to simply hg, then set whatever you need in Custom Configuration (see the inline help). Now just select this alternate installation in your project(s).