In Jenkins, I have a Credential with an ID, a username, a passphrase and a private key.
In my jenkinsfile I try to use ssh-agent like this :
sshagent(['my_credential_id']) {
// sh "git something"
}
But it doesn't work and I don't know why.
Do you know how I can debbug it ?
[Pipeline] { ( [first step] )
[Pipeline] sshagent
[ssh-agent] Using credentials [my credential description]
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine)
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-UZJIW23748/agent.23748
SSH_AGENT_PID=23750
$ ssh-add /app/jenkins-slave/workspace/[project]/[project]@tmp/private_key_[XXXXXXXXXXXXXX].key
ssh_askpass: exec(/app/jenkins-slave/workspace/[project]/[project]@tmp/askpass_[XXXXXXXXXXXXXX].sh): No such file or directory
[Pipeline] // sshagent
[Pipeline] End of Pipeline
ERROR: Failed to run ssh-add