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

Unable to access "SSH Username with private key" in DSL.groovy.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • job-dsl-plugin
    • None

      Is any one using "SSH Username with private key" in DSL.groovy.
       
      I am trying to use two ways but both are giving exception:
      First way:-
      withCredentials([sshUserPrivateKey(credentialsId: 'hop_server_ssh', keyFileVariable: 'hop_file', passphraseVariable: 'hop_passphrase', usernameVariable: 'hop_user_name')]) {
              // some block
          }
       
      Second way:-
      wrappers {
                      credentialsBinding {
                          sshUserPrivateKey(credentialsId: 'hop_server_ssh', keyFileVariable: 'private_key', passphraseVariable: 'hop_phrase', usernameVariable:'hop_user')
       
      Exception:
      ERROR: (job_mi_backend_hop_deploy_dsl.groovy, line 36) No signature of method: javaposse.jobdsl.dsl.jobs.FreeStyleJob.sshUserPrivateKey() is applicable for argument types: (java.util.LinkedHashMap, job_mi_backend_hop_deploy_dsl$_run_closure1$_closure3) values: [[credentialsId:gid-chef-dorch-px, keyFileVariable:hop_file, ...], ...]
       
      Please help me to get access "SSH Username with private key" in DSL.groovy.

            daspilker Daniel Spilker
            jai2307199423 Jai Nath
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: