首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Cirrus CI在构建失败时通知电子邮件

Cirrus CI在构建失败时通知电子邮件
EN

Stack Overflow用户
提问于 2019-05-08 15:41:35
回答 1查看 81关注 0票数 1

我托管了我的source code on github,并在每次签入时添加了一个触发器。当触发器被触发时,Cirrus-CI build tool开始构建我的组件。要实现这一点,必须正确设置github,并且每个组件都必须有一个有效的.cirrus.yml文件,该文件负责构建设置。

如何更改我的配置文件,以便在构建失败时收到通知?

这是我的.cirrus.yml文件:

代码语言:javascript
复制
container:
  image: maven:latest

build_task:
  build_script: mvn clean compile test sonar:sonar

是的,它是相当短的,并且在Cirrus-CI帮助页面上是explanations concering email notificationwriting conditional tasks,但是我不知道如何才能获得构建结果并在该上创建条件。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-09 19:25:00

解决方案很简单,可以是:

代码语言:javascript
复制
container:
  image: maven:latest

build_task:
  build_script: mvn clean compile test sonar:sonar
  on_failure:
    mail_script: mvn postman:send-mail

这需要pom.xml中的postman mail plugin

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56035830

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档