Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56470

Support ssh_agent_plugin with ssh_steps_plugin

XMLWordPrintable

      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 ...

            nrayapati Naresh Rayapati
            jonl_percsol Jonathon Lamon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: