jenkinsci/job-dsl-plugin — pull request #85 by daspilker (2013-08-16 16:05:41+00:00)
Title: Support For SSH Agent Plugin

This pull requests adds support for the [SSH Agent Plugin](https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin).

```groovy
job {
...
sshAgent(String credentials)
...
}
```

Example:

```groovy
job {
...
sshAgent('my-credentials')
...
}
```

Unfortunately the config XML for the SSH Agent Plugin must contain the ID of the credentials and not the clear text name. Since the ID is not visible in the Jenkins web interface, it is not pratical for users to enter the ID in a job DSL script. So I added a method in the JobManagement interface which can lookup the ID of the credentials using the Jenkins API. Since the credentials API is not contained in core Jenkins, I added an optional dependency to the Credentials plugin. A test makes sure that the Job DSL plugin is working if the Credentials plugin is not installed.