How can I assign a build configuration parameter's value to a XML config element? Andrei F. Created December 04, 2015 06:33 subj
Hello,
Could you please detail your question? It's not clear what you mean.
1. I have a value in a build configuration parameter
2. I need to write this value to an element of a XML file, when performing TeamCity build
Thank you for details. There is no special feature to write parameter to XML files.
You can write a script that search needed element and replace the value. Then use TeamCity command line build step to run it. For example see http://stackoverflow.com/questions/18212285/shell-script-for-the-changing-the-element-of-xml.
That's what I was afraid of :)
It would be nice to have a built-in feature for this task.
Well, technically, there is.
You could use the File Content Replacer build feature for this.
https://confluence.jetbrains.com/display/TCD9/File+Content+Replacer
There is probably quite a bit of work involved in getting it to work as you wish though.
Thomas, you are right, File Content Replacer could be configured for this. Thank you for the advice!
De nada
Thanks, but I'd better stick to the script solution. It looks simpler.