node
{
ย ย def credentials = 'somecredentials'
ย ย sshagent (credentials: [credentials])
ย ย {
ย ย ย ย sh ( script:"""
ย ย ย ย rm -rf common_jenkins_jobs
ย ย ย ย git clone ssh://gito...@somerepos.git
ย ย ย ย """)
ย ย }
}
node ( "ci-server-slave" )
{
ย ย def credentials = 'somecredentials
'
ย ย sshagent (credentials: [credentials])
ย ย {
ย ย ย ย sh ( script:"""
ย ย ย ย rm -rf common_jenkins_jobs
ย ย ย ย git clone ssh://gito...@somerepos.git
ย ย ย ย """)
ย ย }
}
but the part that runs on the slave shows the sequence:
leaving the git clone out of the ssh-agent environment and failing due to lack of crecedentials.
I attached the log of the second node on a simpler test where the sh step only runs an ls ltr command. There you can clearly see that the ls command runs after the ssh-agent ends.
ยฟ Can this behaviour be part of some missconfiguration on my part or is a bug on the ssh agent step ?