jenkinsci/job-dsl-plugin — pull request #254 by awreece (2014-08-04 07:56:26+00:00)
Title: Node param

Building on https://github.com/jenkinsci/job-dsl-plugin/pull/238, I added support for nodeParam parameters for freestyle jobs.

This code review was prepared by starting from github.com/langers2k:nodelabelplugin. Afterwards, I rebased back to master.

## Implementation details

The only interesting implementation detail here is that there were several properties in the xml that were solely a function of one input parameter, the trigger.

```xml
multiSelectionDisallowed
false
false
false
```

Using the GUI, I generated xml configs for each possible setting of `triggerIfResult` and hard coded this logic into a `switch`/`case` statement.

## Testing done

In addition to tests included in the diff, I monkey patched the function into `BuildParametersContext.metaClass.nodeParam`, generating a job with the new function. I verified that the configuration of the job looked right in the GUI and verified that I could select which node the build got run on (I verified that the plugin continued to work as expected).