 # Configuration:
 #   HUBOT_TEAMCITY_USERNAME = <user name>
 #   HUBOT_TEAMCITY_PASSWORD = <password>
-#   HUBOT_TEAMCITY_HOSTNAME = <host : port>
+#   HUBOT_TEAMCITY_URL = <scheme://host:port>
 #
 # Commands:
 #   hubot show me builds - Show status of currently running builds

module.exports = (robot) ->
  username = process.env.HUBOT_TEAMCITY_USERNAME
  password = process.env.HUBOT_TEAMCITY_PASSWORD
  hostname = process.env.HUBOT_TEAMCITY_HOSTNAME

  buildTypes = []


    projectSegment = ''
    if project?
      projectSegment = '/projects/name:' + encodeURIComponent project
    url = "#{base_url}/httpAuth/app/rest#{projectSegment}/buildTypes"
    console.log url
    msg.http(url)
      .headers(getAuthHeader())
