TeamCity构建状态参数 [英] TeamCity build status parameter

查看:135
本文介绍了TeamCity构建状态参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能会忽略TeamCity中的内置参数.我正在尝试将构建状态作为参数发送到控制台应用程序.控制台应用程序是一个构建步骤,即使先前的步骤失败了也需要运行.如果前面的步骤失败,它将做一件事,如果前面的步骤成功,它将做另一件事.

我已将控制台应用程序设置为采用构建状态参数,但没有找到要使用的内置构建状态参数(成功/失败).我想念一些容易的事吗?如何访问构建状态?

谢谢!

解决方案

过去,我不得不做类似的事情,并且没有设法找到可以注入以传递状态的内置属性. /p>

最后,我在上一个构建步骤中使用了服务消息将参数传递到后续步骤-打印出类似##teamcity[setParameter name='build.state' value='ok']的消息可用于创建构建属性以将状态从一个步骤传递到另一个步骤.

我已经看到有人采用了TeamCity REST API从构建步骤中查询正在运行的构建状态的方法,但是以前的方法对我来说很简单.

I may be overlooking a built in parameter in TeamCity.. I'm trying to send the build status as a parameter to a console application. The console application is a build step that needs to run even if previous steps have failed. If previous steps failed it will do one thing, and if the previous steps are successful it will do another.

I have the console app set up to take a build status parameter, but I'm not finding a built in build status parameter to use (Success/Failure). Am I missing something easy? How can I access the build status?

Thanks!

解决方案

I've had to do a similar thing in the past and didn't manage to find a built in property that I could inject to pass the status.

In the end I used service messages in a previous build step to pass parameters into the subsequent step - printing out a message like ##teamcity[setParameter name='build.state' value='ok'] can be used to create a build property to thread state from one step to another.

I've seen someone take an approach of using the TeamCity REST API to query the status of the running build from a build step, but the prior approach was simple enough for me.

这篇关于TeamCity构建状态参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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