Passing parameters to dependent builds started from REST API

Hello,

I have an external tool, that is starting build via REST API (/app/rest/buildQueue). In that request, I am also passing some parameters, in my case:

Snippet

env.builder_name

 

Then, I can access this parameter in the build I have started. Let's call it build A. However, build A is dependent on build B (B runs before A) and I would like to access that variable in configuration B. 

I have tried dep.*.env.builder_name and reverse.dep.*.env.builder_name but with no luck :( When either is used in B, the build won't start.

0
3 comments

Using reverse.dep when triggering should work, but you need to ensure that that parameter exists in B first. You can simply create it and leave it empty, simply add its value when triggering.

0

How did you access the env.builder_name parameter in the build?

0

Hi Vinay,

 

You can access any build parameter from a script with the %parameter_name% syntax. It's explained in our docs: https://www.jetbrains.com/help/teamcity/configuring-build-parameters.html#ConfiguringBuildParameters-UsingBuildParametersintheBuildScripts

 

For parameters in scripts defined directly in the settings you can also check this section: https://www.jetbrains.com/help/teamcity/configuring-build-parameters.html#ConfiguringBuildParameters-UsingBuildParametersinBuildConfigurationSettings

0

Please sign in to leave a comment.