在向RocketChat发出构建通知时,构建失败并显示“无协议:/ api / v1 / login”

时间:2018-11-05 23:23:12

标签: jenkins-pipeline

我正在使用以下代码通过RocketChatrocketSend发送构建通知。下面是代码片段:

rocketSend channel: 'jenkins-robot', "Build Notification - STATUS: ${currentBuild.result} - BRANCH: ${env.GERRIT_BRANCH} - PROJECT: ${env.PROJECT} - (<${env.BUILD_URL}|Open>)"

但是我遇到了以下错误:

[Pipeline] rocketSend
RocketChat Send Pipeline step configured with channel: jenkins-robot 
  message: Build Notification - STATUS: null - BRANCH: release-1.2 -  
  PROJECT: test - (<URL/|Open>)

 [Pipeline] }
 [Pipeline] // node
 [Pipeline] End of Pipeline
 java.net.MalformedURLException: no protocol: /api/v1/login

我不确定为什么会出现java.net.MalformedURLException: no protocol: /api/v1/login错误。

1 个答案:

答案 0 :(得分:0)

以下代码已修复此问题:从火箭发送命令中删除了“频道”信息

 rocketSend "Build Notification - STATUS: ${currentBuild.result} - BRANCH: ${env.GERRIT_BRANCH} - PROJECT: ${env.PROJECT} - BUILD_URL: (<${env.BUILD_URL}|Open>)"