2 Replies Last post: Feb 24, 2014 12:34 AM by Simone Busoli  
Simone  Busoli Novice 203 posts since
Jun 20, 2005
Currently Being Moderated

Feb 22, 2014 8:24 PM

Use properties set in build scripts from within TeamCity

Hello, I'm wondering if there's a way to use from within TeamCity properties that are set in build scripts. For example, I have a MSBuild script which sets some properties for locations where it puts binaries, and I'd like to use them from within TeamCity, for example to configure artifact paths. Is there a way to expose such properties from the build script so that TeamCity can use them?

 

Thanks

Bryan N Newbie 23 posts since
Oct 13, 2011
Currently Being Moderated
Feb 24, 2014 12:15 AM in response to: Simone Busoli
Re: Use properties set in build scripts from within TeamCity

If your MSBuild script can write to the console, you could use service messages to set a parameter value.

 

For example, write the following string to the console:

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

 

TeamCity will create a parameter named 'ddd' which can be used in subsequent build steps.

 

http://confluence.jetbrains.com/display/TCD8/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-AddingorChangingaBuildParameter

 

Also, it looks like TeamCity has MSBuild Service Tasks (http://confluence.jetbrains.com/display/TCD8/MSBuild+Service+Tasks); however, setParameter doesn't seem to be supported.

 

-Bryan

More Like This

  • Retrieving data ...