2017-08-30 23 views
0

我無法資助當hubot回覆請求時存儲鬆散用戶標識的位置。我希望hubot能夠將這個值與作業命令一起傳遞給jenkins。通過params對象將其粘貼到請求上hubot jenkins.coffee哪裏是鬆弛用戶標識存儲

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) 

回答

0

從這個post

slackid掏出一個答案是msg.message.user.name