During my recent migration from using SVN to using GIT for my open source projects I was reconfiguring my Hudson CI server and started seeing this message:
Caused by: hudson.plugins.git.GitException: Command returned status code 128:
*** Please tell me who you are.
git config --global user.email "email@example.com"
git config --global user.name "Your Name"
I was a little confused to see this message since I had already configured git to have my user name and email. Then I remembered that hudson is running on tomcat which is running with the tomcat6 user. I needed to configure the tomcat6 user to have the git configuration necessary to tag on the git repositories.
[UPDATE: 24 Jun 2010]
I was working on repeating this process on Ubuntu 10.04 and was getting permission errors running the command to set the git config for the tomcat6 user. Here is an updated method:
First we need to create a
.gitconfig file for the tomcat6 user:
sudo touch /usr/share/tomcat6/.gitconfig
sudo chown tomcat6:tomcat6 /usr/share/tomcat6/.gitconfig
sudo nano /usr/share/tomcat6/.gitconfig
Place the following in the
name = Hudson
email = hudson@myDomain.com
Once the file is saved–you may need to restart Tomcat–it should pick up your git configuration.
[ORIGINAL: see updated instructions above]
Setup the git configuration for the tomcat6 user by doing the following:
sudo -s -H -u tomcat6
git config --global user.name "Hudson"
git config --global user.email "firstname.lastname@example.org"
As a note, if you are using hudson to commit and push to another repository these configuration settings will be used for all commits done by Hudson.
The next step is to let hudson know where the
HOME is for the tomcat6 user. On the
hudson/configure page there is a checkbox for defining
environment variables. Once it is checked you will be able to put in a key-value pair. Add the following pair and save your configuration:
The next time a hudson project is built you should see the following line close to the top of the console output:
The git plugin should now be able to successfully tag the repository and continue with the build.