-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
It would be great if the ssh agent plugin were supported so you could do the following
def deployServer = 'remote.com' def deployUser = '' ssh_agent([deployCreds]) { withCredentials([sshUserPrivateKey(credentialsId: deployCreds, keyFileVariable: 'ssh_key', passphraseVariable: 'ssh_pw', usernameVariable: 'ssh_user')]) { writeFile file: 'abc.sh', text: 'ls' def remote = [:] remote.name = deployServer remote.host = deployServer remote.user = "${env.ssh_user}" remote.agent = true remote.allowAnyHosts = true sshCommand remote: remote, command: 'for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done' sshPut remote: remote, from: 'abc.sh', into: '.' } }
Currently when attempting this, an error is received:
com.jcraft.jsch.agentproxy.AgentProxyException: connector is not available: at com.jcraft.jsch.agentproxy.ConnectorFactory.createConnector(ConnectorFactory.java:120) at com.jcraft.jsch.agentproxy.ConnectorFactory$createConnector.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) at ...