0

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 "you@example.com"
[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.

m19v
  • 1,800
  • 4
  • 11
  • 26

1 Answers1

0

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 "you@example.com"
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"
christopo
  • 176
  • 4
  • 13
  • Adjusted the question. Unfortunately setting user name and email can not be considered in my case. – m19v Jun 02 '22 at 11:53
  • 1
    Why? You could drop `--global` to set it for the repository only. Obviously your mvn goal tries to push to git, in this case git requires you to provide a name and email. – christopo Jun 02 '22 at 11:55
  • Because it runs on Remote Jenkins and I do not have an access. By asking it I wanted to check whether there is another way to solve this problem. – m19v Sep 15 '22 at 11:33