【问题标题】:hubot jenkins.coffee where is slack userid storedhubot jenkins.coffee slack 用户 ID 存储在哪里
【发布时间】: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


    【解决方案1】:

    从这个post中找出答案

    slackid 是 msg.message.user.name

    【讨论】:

      猜你喜欢
      • 2011-06-26
      • 1970-01-01
      • 1970-01-01
      • 2018-12-23
      • 1970-01-01
      • 1970-01-01
      • 2019-08-06
      • 2017-01-21
      • 2018-05-14
      相关资源
      最近更新 更多