4

Is it possible to perform a search over all the configuration parameters in a server?

The reason I'm asking is because I have a path that points to a specific C# solution, and I need to update it, but I don't want to have to look in every build configuration.

Maria Ines Parnisari
  • 16,584
  • 9
  • 85
  • 130

2 Answers2

4

Basically under the hood all your TeamCity build configurations are just XML files in the BuildServer\config\projects\ folder and sub folders. You can just do a grep over those XML files to find your configuration parameter.

I have done mass find and replace operations on those XML files before without problems (of course got to make sure that what you are replacing is not used anywhere else in the XML, and always keep a backup).

BrokenGlass
  • 158,293
  • 28
  • 286
  • 335
  • Thanks! So in my case I just had to search in `C:\ProgramData\JetBrains\TeamCity\config`. – Maria Ines Parnisari Dec 29 '14 at 17:24
  • Does anyone know if this is still true in 2019 or if there is something that could perform the same action? Even if I have to change the configurations by hand it would be nice to know which to look in. – davidk May 20 '19 at 19:07
  • 2
    I can confirm this is still true, I used the following PowerShell script to find all files with a parameter named VCSRootPath `$allConfig = Get-ChildItem C:\ProgramData\Jetbrains\TeamCity\config\projects -File -Filter "*.xml" -recurse foreach ($config in $allConfig) { if (Get-Content $config.FullName | select-string 'param name="VCSRootPath"') { $config.FullName } }` – Tim Aitken Feb 10 '20 at 04:56
0

On our on prem TeamCity 2018.1.3 install the buildSettings are stored in /data/teamcity-data/system/artifacts

The following grep term will find all the things you are looking for

grep -rPe "searchRegexHere" --include buildSettings.xml .

Damo
  • 5,698
  • 3
  • 37
  • 55