github/hubot-scripts — pull request #1526 by wintondeshong (2014-07-29 15:37:07+00:00)
Title: Jenkins multiple server support

Our team continually has issues setting up master/slave relationships with jenkins servers of varying versions and operating systems (ie. windows, ubuntu, mac osx), but we still want to manage jobs with hubot across all jenkins servers. So I extended the hubot jenkins script to work with N number of jenkins servers.

**Part 1: Refactoring**
Before proceeding with adding multiple server support this file required some much needed TLC. I started by removing the use of nested closures by using named callbacks, created small single purpose functions and refactored portions of the application that redundant in an effort to be DRY. The final step in the refactoring was to identify methods disguising themselves as objects and created classes.

**Part 2: Multiple Server Support**
I've extended the configuration of this script to allow for N number of jenkins servers. The existing API has remained in tact. Aside from structural and configuration changes, the only other highlight is that now when a given command is executed jenkins may take a few seconds to retrieve the latest job information across the configured number of servers before running the specific command.