在CircleCI上,如何触发一个接一个的构建,但前提是第一个构建为绿色 [英] On CircleCI, how can I trigger one build after another, but only if the first is green

查看:60
本文介绍了在CircleCI上,如何触发一个接一个的构建,但前提是第一个构建为绿色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法创建了一个CircleCI构建,该构建使用其API使用 curl 触发了后续构建。我已将此添加到我的 circle.yml

I've managed to create a CircleCI build that triggers a subsequent build using their API using curl. I've added this to my circle.yml:

test:
 override:
  - mvn test -s settings.xml
  - mvn deploy -Prun-its -s settings.xml
  - curl -v -X POST https://circleci.com/api/v1/project/alexec/docker-maven-plugin/tree/master?circle-token=$CIRCLE_TOKEN

仅在所有前面的步骤都是绿色的情况下,才如何触发?

How do I trigger only if all of the previous steps are green?

推荐答案

我认为您应该这样做在 deployment 部分中:由于-按照定义-仅在一切正常的情况下运行,这应该可以解决问题。

I think you should do this in the deployment section: Since this is - by definition - only run if everything is fine, this should do the trick.

有关详细信息,请参见其部署文档。在那里显示:

See their documentation on deployment for details. There it says:


这些命令仅在成功(绿色)构建之后才触发。

These commands are triggered only after a successful (green) build.

这篇关于在CircleCI上,如何触发一个接一个的构建,但前提是第一个构建为绿色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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