5

I have found a way to change a property in TeamCity:

##teamcity[setParameter name='ddd' value='fff']

But unfortunately this change only occurs for the current build. I want this change to be PERMANENT, but TeamCity only changes this for the current running build.

How do I make a permanent change to a system property in TeamCity?

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Tjaart
  • 3,912
  • 2
  • 37
  • 61
  • I usually edit the configuration files. Which property are you trying to set? – AlG Mar 20 '12 at 14:50
  • Its a custom system property. Im trying that route now. Python script that edits the config file. – Tjaart Mar 20 '12 at 15:25
  • In TeamCity 7.0 you can change build configuration parameters using REST API, see http://confluence.jetbrains.net/display/TW/REST+API+Plugin#RESTAPIPlugin-BuildConfigurationAndTemplateSettings. – Pavel Sher Mar 20 '12 at 22:03
  • I am aware of that. Sadly we can't upgrade at the moment. – Tjaart Mar 21 '12 at 00:56

2 Answers2

0

The only solution using TeamCity 6.5 was to edit the Xml configuration file programmatically using a python script.

A build step calls the python script to change the variable during each build.

Tjaart
  • 3,912
  • 2
  • 37
  • 61
0

Use the REST API which is a feature of TeamCity 7.0

Api details here - http://confluence.jetbrains.com/display/TW/REST+API+Plugin#RESTAPIPlugin-BuildConfigurationAndTemplateSettings

I use this method to get and set properties from powershell during a build.

rsw
  • 89
  • 6
  • Thank you. I am fully aware of this feature but I was limited to version 6.5 when I had this problem, so the API is not relevant. I specified the version of TC in the question. – Tjaart Feb 25 '13 at 08:08
  • You did but I was also not aware/sure that 6.5 was a hard restriction. The API is also very easy to use and I'd encourage the upgrade. – rsw Feb 26 '13 at 10:41
  • The problem with this solution is authentication. I need my build agents to be able to change one parameter in the build, but I don't want to deploy credentials to them, and I don't think the user management is granular enough anyway to let me specify that they should only be able to change that one parameter. – Mysterious Dan Aug 05 '13 at 21:28