【发布时间】:2018-02-08 08:10:47
【问题描述】:
当 hubot 回复请求时,我无法为 Slack 用户 ID 的存储位置提供资金。我希望 hubot 将该值与作业命令一起传递给詹金斯。通过 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)
【问题讨论】:
标签: jenkins coffeescript slack hubot