Getting Cannot find mercurial executable at path 'hg' - mercurial

I am using VCS checkout mode to agent side and also have defined the teamcity.hg.agent.path = c:\program files\mercurial\hg.exe in agent.properties file. Still VCS is not picking up this setting and giving me the following error:-
Test connection failed in Dev :: Stocks :: Build and Package. Cannot find mercurial executable at path 'hg'
Also have defined the path in windows environment variables. Mercurial is not installed on server machine. I have read in documentation that if you are using a agent side checkout then not required. Please guide what I am missing here.
thanks

According to the documentation, if you're using server side checkout, then you don't need to install mercurial on your agent.
But when you set up version control as a VCS root, you do need the TeamCity server to be able to talk to the mercurial server so it can do things like detect changes. The JetBrains documentation specifically says that if you're using a Mercurial VCS root:
Mercurial should be installed in the server machine, and, if
agent-side checkout is used, on the agents.

Related

Bamboo and perforce integration issue

I am trying to add perforce repository for bamboo. But not able to make it. Getting following error while adding repository-
I have downloaded latest bamboo 30days trial and installed on my local machine. Bamboo is installed correctly as I am able to create automated build using MSBuild with BitBucket repository.
My bamboo instance is running on http://localhost:8085.
I have Downloaded and installed latest P4D and P4V from https://www.perforce.com/downloads and installed in the same machine. Perforce server and client are correctly configured as I am able to checkin source code to server using client. Running on port 1666. By client and server are both installed in C:\Program Files\Perforce.
I have added bamboo Server Capabilities for perforce.
On providing perforce detail while adding repository, getting following three alerts from p4v client-
User id and password are correct also url with port is correct. I am able to get data from repository with this detail.
p4v.exe is already there in my PATH and also I run p4v -help on command prompt, getting following result. I dont see any option named 'info'.
p4v.exe is the GUI program for Perforce.
There is a command-line program for Perforce, called p4.exe.
When Bamboo says that it wants The location of the p4 client executable, you have to specify the path to p4.exe, not the path to p4v.exe.
When you downloaded and instlaled p4v.exe on your system, you should also have received a p4.exe (if not, download that program, too). Then specify the path to p4.exe to Bamboo.

On TeamCity, Mercurial repo is checked out without execute bit set

In my Mercurial repository, I have some build scripts. However, when TeamCity checks out the repo, it doesn't set the execute bit on them, even though it's set in the repository. The build then fails, as it can't run the scripts, as you would expect. How do I make TeamCity respect the execute bit?
I am running TeamCity 9.0 on Ubuntu Server 14.04.
Changing the VCS checkout mode to Agent rather than Server fixed this problem for me.
To change the VCS checkout mode:
On the project configuration settings, go to Version Control Settings
Click on Show advanced options
Change VCS checkout mode from Automatically on server to Automatically on agent

Mercurial on Jenkins, installing and configuring

I have a Mercurial repository (on Bitbucket) with some code (Java) and I want to do CI builds on a cloud-based Jenkins server (at Jelastic, running on CentOS). My problem is that I haven't been able to do a proper installation of Mercurial on the Jenkins server.
The Jenkins build fails with the following message:
ERROR: Failed to clone https://bitbucket_jenkins_user:some_password#bitbucket.org/repo_owner/my_repository because hg could not be found; check that you've properly configured your Mercurial installation
Setup information
It's a private Mercurial repository, hosted at Bitbucket
In Bitbucket I have set up a Service to trigger the Jenkins build, after a Push has happened
I have defined a specific bitbucket jenkins user in my Mercurial repository, it has only read rights and it logs in using simple https authentication
Jenkins runs on a Tomcat 7, hosted in a Jelastic cloud environment, on CentOS 6
The Mercurial plugin was installed through the Jenkins interface, by Manage plugins
The build is configured as being triggered remotely (by the service defined in Bitbucket)
Build results are the same when started manually and when triggered from a push to the repository
When I first did this I was under the impression that installing the Mercurial plugin in Jenkins would be enough, that it would also install the needed Mercurial binaries to be able to connect to the repository and get the code. I have realized that I was wrong and that on the Manage Jenkins / Configure System page I need to specify my Mercurial installation.
Questions
Is it possible to create a Mercurial installation without ssh access and doing a "yum install mercurial"?
In the Jenkins interface, what can I specify when choosing the "Install Automatically" option?
When defining an installer, I have experimented with the "Extract zip/tar.gz" option, but what can I write as the "Download URL for binary archive"?
Jenkins also offers an installer option of "Run command". What kind of commands could that be, maybe a "yum install ..." or "rpm ..."?
Since my server is cloud based, getting ssh access is a paid add-on which I would prefer to avoid. But if that is my only option I will of course do it, thereby getting access to running commands on the server. However, running "yum install mercurial" on Centos seems to only give the 1.4 version of Mercurial. Current version when I write this is 2.6.3, would I need to download the sources and compile it myself or is it possible to get that as a binary for Centos somewhere?
The Mercurial Plugin page has a section on how to use the Auto Installation options to install Mercurial using ArchLinux packages.
"The plugin supports generic tool auto-installation methods for your Mercurial installation, though it does not publish a catalog of Mercurial versions. For users of Linux machines (with Python preinstalled), you can use ArchLinux packages. For example, in /configure under Mercurial installations, add a Mercurial installation with whatever Name you like, Executable = INSTALLATION/bin/hg, Install automatically, Run Command, Label = linux (if desired to limit this to slaves configured with the same label), Command = [ -d usr ] || wget -q -O - http://www.archlinux.org/packages/extra/i686/mercurial/download/ | xzcat | tar xvf - (or …/x86_64/… for 64-bit slaves), Tool Home = usr, and configure a job with this installation tied to a Linux slave."
see https://wiki.jenkins-ci.org/display/JENKINS/Mercurial+Plugin

Defining a Jenkins Build Job Based on a Kiln Mercurial Repository

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?
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

Configuring Bazaar in Hudson

I am trying to configure a task in Hudson for a VC++ project. I was able to build a project from the file system with MSBuild task. But when I try to configure the task to check out a bazaar repo to do the build, checkout is always failing in authentication. Bazaar passwordless access is setup on the machine and when I use bzr cmd line, checkout is happening without password. Another post suggested that I should have the id_rsa in C:\Documents and Settings\Administrator.hudson - but that also did not help. In Subversion config I saw a way of mentioning username and password. Is there any way to get around this problem.
I assume you have set up the authentication in the windows equivalent of ~/.bazaar/authentication.conf (use bzr version -v to get the correct location).
Is hudson running as the same user as the one you use to connect with the command-line? Because that will impact which authentication.conf it will try to use.
My hudson is using authentication.conf fine but I run it on Ubuntu.
I solved the problem. The authentication.conf is not being considered in windows. I made the repo accessible through http and configured the bazaar with that URL. It was able to download the repo with http protocol without asking for password. One more thing I did was I created a username in hudson, which I matched with a user having access in the bazaar repo which solved another problem which was asking for a user named pwd.