将构建错误发布到Slack或github [英] Posting build errors to slack or github

查看:109
本文介绍了将构建错误发布到Slack或github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio Online进行持续集成.我还启用了与Slack(发布构建状态)和GitHub(验证请求请求)的集成.

I am using Visual Studio Online for continuous integration. I've also enabled integration with Slack (posting build status) and GitHub (validating pull requests).

在这两个集成中,我都缺少一个功能-将构建错误日志发布到Slack或GitHub(例如,作为对pull请求的注释).这可能会大大缩短响应时间,因为您无需转到失败的构建(通常重新登录到VSO),在日志中查找错误等.

In both of these integrations I am missing one feature - posting build error log to either Slack or GitHub (for example, as a comment to the pull request). This might substantially improve reaction time, since you don't need to go to the failed build (often re-login to VSO), find errors in the log, etc.

你们有没有设法以某种方式使它正常工作?

Did any of you guys manage to get this working somehow?

推荐答案

您可以使用

You can use web hook to return VSTS build error message to slack or do some actions (create issue, close pull request etc) on github.

用于VSTS构建的Web挂钩失败.

Web hook for VSTS build failed.

开发一个网站以接收信息,将VSTS构建排队,并在github上关闭拉取请求.

Develop a website to receive information, queue VSTS build and close pull request on github.

在您的VSTS上,使用发布到松弛任务添加构建定义.构建失败,您的网站将对该构建进行排队.

Add a build definition with Post To Slack task, when your VSTS build failed, your website will queue this build.

VSTS项目->服务挂钩->创建订阅->网钩->下一个->选择构建完成以触发此事件->选择您的CI构建定义->将Build Status设置为Failed->下一个->将您的网站地址设置为URL->测试它是否适用于您的网站->完成.

VSTS project -> Service Hooks -> Create subscription -> Web hooks -> Next -> select Build completed to trigger this event -> select your CI build definition -> set Build Status to Failed -> Next -> set your website address to URL -> test if it works for your website -> Finish.

您的网站收到来自Web钩子的消息后,触发以下操作:

After your website receiving message from web hooks, trigger below actions:

  1. 通过 REST API .
  2. 通过 REST API v3 REST API v3 .
  1. Queuing the build with Post To Slack task by REST API.
  2. Close a pull request on github by REST API v3.

这篇关于将构建错误发布到Slack或github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆