 #   "hubot-auth"
 #
 # Configuration:
-#   HUBOT_RUNDECK_URL
+#   HUBOT_RUNDECK_URL - root URL for Rundeck, not including api path
 #   HUBOT_RUNDECK_TOKEN
 #   HUBOT_RUNDECK_PROJECT
 #

  constructor: (@robot) ->
    @logger = @robot.logger

    @baseUrl = process.env.HUBOT_RUNDECK_URL
    @authToken = process.env.HUBOT_RUNDECK_TOKEN
    @project = process.env.HUBOT_RUNDECK_PROJECT
    @adminRole = "rundeck_admin"

      rundeck.jobs().run name, null, (job, results) ->
        if job
          robot.logger.debug inspect(results, false, null)
          msg.send "Running job #{name}: #{results.executions.execution[0]['$'].href}"
        else
          msg.send "Could not execute Rundeck job \"#{name}\"."
    else
