Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
node {
withEnv(['PATH+GIT=C:\\Program Files\\Git\\usr\\bin\\']) {
echo env.PATH.split(/;/).join("\n")
if (fileExists('c:\\Program Files\\Git\\usr\\bin\\ssh-agent.exe')) {
echo 'Yes'
} else {
echo 'No'
}
sshagent (credentials: ['foo']) {
sh 'ssh -o StrictHostKeyChecking=no -l 1.2.3.4 uname -a'
}
}
}
@lpetre

This comment has been minimized.

Copy link
Owner Author

commented Feb 27, 2017

Could not find ssh-agent: IOException: Cannot run program "ssh-agent": CreateProcess error=2, The system cannot find the file specified
Check if ssh-agent is installed and in PATH
@lpetre

This comment has been minimized.

Copy link
Owner Author

commented Feb 27, 2017

[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] echo
C:\Program Files\Git\usr\bin\
...
[Pipeline] fileExists
[Pipeline] echo
Yes
[Pipeline] sshagent
[ssh-agent] Using credentials ec2-user (hns-test-ssh)
[ssh-agent] Looking for ssh-agent implementation...
Could not find ssh-agent: IOException: Cannot run program "ssh-agent": CreateProcess error=2, The system cannot find the file specified
Check if ssh-agent is installed and in PATH
[ssh-agent] FATAL: Could not find a suitable ssh-agent provider
[ssh-agent] Diagnostic report
[Pipeline] // sshagent
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
java.lang.RuntimeException: [ssh-agent] Could not find a suitable ssh-agent provider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.