TeamCity 作业,仅在前一个作业失败时才运行步骤? [英] TeamCity job, run step only if a previous one has failed?

查看:33
本文介绍了TeamCity 作业,仅在前一个作业失败时才运行步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 TeamCity 7 并想知道是否可以仅在前一个步骤失败时才运行步骤?我们在构建步骤配置中的选项让您可以选择仅在所有步骤都成功时执行,即使步骤失败,或者始终运行它.

We're using TeamCity 7 and wondered if it's possible to have a step run only if a previous one has failed? Our options in the build step configuration give you the choice to execute only if all steps were successful, even if a step failed, or always run it.

有没有办法只在前一步失败时才执行一个步骤?

Is there a means to execute a step only if a previous one failed?

推荐答案

没有办法设置一个步骤,只有在前一个步骤失败时才执行.

Theres no way to setup a step to execute only if a previous one failed.

我见过的最接近的是设置一个具有完成构建"触发器的构建,该触发器将在您的第一个构建完成后始终执行.(无论成功或失败).

The closest I've seen to this, is to setup a build that has a "Finish Build" trigger that would always execute after your first build finishes. (Regardless of success or failure).

然后在第二次构建中,您可以使用 TeamCity REST API 来确定第一次构建的最后一次执行是否成功.如果它不成功,那么你可以做任何你想做的事情.

Then in that second build, you could use the TeamCity REST API to determine if the last execution from the first build was successful or not. If it wasn't successful then you could whatever it is you want to do.

这篇关于TeamCity 作业,仅在前一个作业失败时才运行步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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