0
votes

In Teamcity 9.0.1 I have several builds, which ends up on similar steps, but with different parameters.

In fact, those are servicing steps, not needed by a build to conclude, that build is ok, but they are needed for service, so, currently, they are just running and consuming time.

What I am trying to reach - is move those steps to completely separate build, and invoke it on successful build end trigger. However, I could not figure out - how to pass changes parameters to these newly created build?

Snapshot dependency does not give me level of control I would like to have, as it requires me to define dependency parameters from specific build id, instead of reading them from build, which just ends.

Using artifact dependency by downloading .teamcity/properties/build.finish.gz!** fails with error:

Unknown archive type

and, actually, will oblige me to create additional xml parser

1

1 Answers

1
votes

There's nothing built in to trigger builds with custom parameters on a finish-build trigger.

You will have to use the TeamCity REST API / HTTP endpoint to trigger the servicing build with custom parameters - you can pass them as key/value pairs using the following syntax (preferably use HTTPS of course):

http://testuser:[email protected]:8111/httpAuth/action.html?add2Queue=MyBuildConf&name=<full property name1>&value=<value1>&name=<full property name2>&value=<value2>

For further information see the docs.

Implementation-wise you should be able to do what you want in a few lines of powershell as a last step in the triggering build configs - they would have to pass the build parameters you want. If you use this in multiple build configurations I'd move this step into a common template or use a meta-runner.