Search code examples
mercurialhudsonjenkinsgoogle-code

How to clone a googlecode mercurial repository in jenkins


I am having a problem to trigger a repository clone of googlecode project.

I keep receiving the following error:

Started by user anonymous $ hg clone --rev default "https://[email protected]/hg/ " "F:\Hudson\jobs\project Demostration project\workspace" abort: demo.projectname.googlecode.com certificate error: certificate is for *.googlecode.com, googlecode.com, *.codespot.com, *.googlesource.com, googlesource.com (use --insecure to connect insecurely) ERROR: Failed to clone. --template {node}

Anyone know on how to tell jenkins it is safe to use that certificate? In what textbox do you place --insecure option

enter image description here


Solution

  • That's a relatively new command line option (1.8.3 I think) to get around a relatively new practice of actually checking certificates (1.8.2 I think). It's likely not exposed in the Jenkins UI. Some things you could do to work around it:

    • put the server's cert's fingerprint in a whitelist in your (Jenkin's user's) hgrc
    • wrap Mercurial in a quick shell script that passes --insecure
    • clone from the non-https version of the google URL (I think they still allow that)
    • configure the CACerts for Mercurial either globally (/etc/mercurial/hgrc) or in the Jenkins user's ~/.hgrc

    Any of those should work and most of them are explained here: https://www.mercurial-scm.org/wiki/CACertificates