I get the following error while running gitflow command, e.g. gitflow:release-start with ssh-agent defined as follows in Jenkinsfile

node {
  sshagent (credentials: ['deploy-dev']) {
    sh 'mvn gitflow:release-start'
  }
}
[ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.18.0:release-start (default-cli) on project testing: 
[ERROR] *** Please tell me who you are.
[ERROR] 
[ERROR] Run
[ERROR] 
[ERROR]   git config --global user.email "[email protected]"
[ERROR]   git config --global user.name "Your Name"
[ERROR] 
[ERROR] to set your account's default identity.
[ERROR] Omit --global to set the identity only in this repository.
[ERROR] 
[ERROR] fatal: empty ident name (for <****@<hashcode>f.(none)>) not allowed
[ERROR] -> [Help 1]

Unfortunately setting user email and name can not be considered as solution in my case.

1

There are 1 best solutions below

3
On

The problem is that your git configuration on the node is incomplete (probably not existing).

The message thrown gives already the answer. You must configure user.email and user.name in the git config of the node.

You could either do this by ssh onto your node and run:

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

or do this as a sh command within the Jenkinsfile (before the mvn step). You might consider dropping --global in this case.

To check the current config, just run.

ssh node "git config --get user.name"
ssh node "git config --get user.email"