1

I would like to set a variable of some description in one step of by build configuration that I can use in another step.

So in step 1 I set the variable and in step 2 i read the variable

Is this possible?

jaywayco
  • 5,846
  • 6
  • 25
  • 40

1 Answers1

2

To do it within the same build configuration you would need to use service messages

To share between build configurations within the same project you can do it via Project parameters. Currently as of TeamCity 8.1, to set it in the build you would need to add a step to run curl.exe utility and set parameter value via TeamCity REST API.

C:\Path\To\curl.exe -v --request PUT -d "YourParamValue" --Header "Content-Type: text/plain" http://YourUser:YourPassword@YourTeamcity.server.local:port/httpAuth/app/rest/projects/YourProjectName/parameters/YourParameter

Related: Teamcity, set configuration parameter for next build

TeamCity, passing an id generated in one build step to a later build step

Community
  • 1
  • 1
Rod
  • 1,443
  • 15
  • 17
  • 1
    Yeah, service messages are what I was looking for. "##teamcity[setParameter name='foo' value='bar']" did the trick. – jaywayco Nov 14 '14 at 06:58