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

Specifying credentials for git remote doesn't work.

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • job-dsl-plugin
    • None
    • jenkins 1.609.3
      job-dsl-plugin 1.38
      credentials plugin 1.23
      git plugin 2.4.0

      job dsl plugin documentation has this example:

      // use the github-ci-key credentials for authentication with GitHub
      job('example-1') {
          scm {
              git {
                  remote {
                      github('account/repo', 'ssh')
                      credentials('github-ci-key')
                  }
              }
          }
      

      I'm trying to use it in similar manner:

            freeStyleJob("layer-${section}") {
              scm {
                git {
                  remote {
                    url(src_uri)
                  }
                  cloneTimeout(30)
                  credentials("github-ouruser-ssh")
                }
              }
              triggers {
                scm('H/5 * * * *')
              }
            }
      

      As result, getting error:

      ERROR: (script, line 21) No signature of method: javaposse.jobdsl.dsl.helpers.scm.GitContext.credentials() is applicable for argument types: (java.lang.String) values: [github-ouruser-ssh]

      Which part is wrong ? documentation, my script or something else in environment ?

            daspilker Daniel Spilker
            kad Alexander Kanevskiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: