Bamboo version 6.8.1 with Mercurial 4.2.1 running on a Windows Bamboo host.
- Add a Mercurial repository to a Bamboo build plan, either as a Linked repository or plan internally.
- Configure this build plan's "Remote trigger" to use the Mercurial repository just by following Repository triggers the build when changes are committed and thus prepare it by copying the SVN postCommitBuildTrigger.py script into your local repository folder and there edit .hg/hgrc adding adding the [hooks]section.
- For the postCommitBuildTrigger script use your Bamboo URL with HTTPS protocol.
- Now modify at least one of the repository files and then hg add plus hg commit the change.
The build should automatically be triggered.
Build is mostly not triggered (sporadically tiggering appears to work).
The Bamboo logs show no errors related to this, however the postCommitBuildTrigger.py script indicates the below (or similar messages) when failing:
From the Python errors showing up, it seems like the issue is triggered by HTTPS used for Python lib urllib (Mercurial for Windows comes with a Python built-in and thus a PY script needs to be used for postCommitBuildTrigger).
The affected Mercurial version uses Python 2.7. From Mercurial 5.0 and higher Python 3 is bundled.
- Use HTTP instead of HTTPS as Bamboo URL for the postCommitBuildTrigger Python script ( note that you need to potentially first adapt your Connector settings in server.xml so that the default 8085 Connector exists). This workaround made the HG trigger function.
- Potentially a Mercurial upgrade to 5.x might do the trick (also see Note above).
- Another chance could be to tune the postCommitBuildTrigger script trying to pass by the found Python 2.7 / urllib issue (some WEB posts point to that).