当hubot回复请求时,我无法为存储松弛用户ID的位置提供资金。我希望hubot将该值与job命令一起传递给jenkins。通过params对象将其粘贴到请求上
robot.respond /j(?:enkins)? build ([\w\.\-_ ]+)(, (.+))?/i, (msg) ->
jenkinsBuild(msg, false)
是否在msg对象中?
jenkinsBuild = (msg, buildWithEmptyParameters) ->
url = process.env.HUBOT_JENKINS_URL
job = querystring.escape msg.match[1]
params = msg.match[3]
command = if buildWithEmptyParameters then "buildWithParameters" else "build"
path = if params then "#{url}/job/#{job}/buildWithParameters?#{params}" else "#{url}/job/#{job}/#{command}"
req = msg.http(path)