for example, I need to pass a configuration paramters whose value is "abc%123", but when I encho the values, it is always "abc123", even I followed http://confluence.jetbrains.com/display/TCD8/Defining+and+Using+Build+Parameters+in+Build+Configuration change the value to "abc%%123", the value echoed is still "abc123". I use the teamcity 8.0.4. Does any body hear know how to solve this issue?
Asked
Active
Viewed 2,553 times
3
-
1When having issues, especially with parameters, I create a new project with only one build step, generally a command line, so I can test this stuff out. It saves a lot of time and lets you hack on it pretty quickly. Use that with MrTaunus' answer below. – Damon Mar 04 '14 at 16:06
1 Answers
4
When you enter the parameter value, you must escape the % with %%, i.e. abc%%123 instead of abc%123. Check out Using the percent sign in TeamCity build scripts for more in depth discussion.
Community
- 1
- 1
Tuukka Haapaniemi
- 1,156
- 1
- 11
- 24
-
@TuukkaHaapaniemi I have value with two percentage sign like 'abc%%123'. To escape in team city I added value like this 'abc%%%%123'. but teamcity is still resolving it as 'abc%123'. – Anil Dec 14 '18 at 21:57
-
@Anil It seems the escaping is dependent on the place where it's used. As per this https://stackoverflow.com/questions/4389946/using-the-percent-sign-in-teamcity-build-scripts I'd try with doubling the percentage signs, so in effect 8 signs: 'abc%%%%%%%%123'. Does that work for you? I don't have a TeamCity instance any longer to test this on, as I've moved to use Azure DevOps CI and CD pipelines. – Tuukka Haapaniemi Dec 18 '18 at 06:32