[JIRA] (JENKINS-59143) Unable to access "SSH Username with private key" in DSL.groovy.

9 views
Skip to first unread message

jainath2312@gmail.com (JIRA)

unread,
Aug 29, 2019, 2:15:03 PM8/29/19
to jenkinsc...@googlegroups.com
Jai Nath created an issue
 
Jenkins / Bug JENKINS-59143
Unable to access "SSH Username with private key" in DSL.groovy.
Issue Type: Bug Bug
Assignee: Joe Roberts
Components: job-dsl-plugin
Created: 2019-08-29 18:14
Priority: Major Major
Reporter: Jai Nath

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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mail@daniel-spilker.com (JIRA)

unread,
Sep 2, 2019, 4:40:02 PM9/2/19
to jenkinsc...@googlegroups.com
Daniel Spilker updated Bug JENKINS-59143
 

Use the embedded API viewer to lookup the correct syntax, see Dynamic DSL for details.

job('example') {
  wrappers {
    credentialsBinding {
      sshUserPrivateKey {
        keyFileVariable('KEY_FILE')
        credentialsId('test')
        passphraseVariable('PASSWORD')
        usernameVariable('USERNAME')
      } 
    }
  }
}

Use Stack Overflow or the mailing list for asking questions about syntax.

Change By: Daniel Spilker
Status: Open Fixed but Unreleased
Assignee: Joe Roberts Daniel Spilker
Resolution: Not A Defect

jainath2312@gmail.com (JIRA)

unread,
Sep 3, 2019, 2:12:02 AM9/3/19
to jenkinsc...@googlegroups.com

mail@daniel-spilker.com (JIRA)

unread,
Mar 11, 2020, 9:02:04 AM3/11/20
to jenkinsc...@googlegroups.com
Change By: Daniel Spilker
Status: Fixed but Unreleased Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages