TeamCity Source Path variable

I am using TeamCity to pack various components of a Windows desktop application for Octopus deploy.

Can I use a variable to point to the folder where the application was built? The GUID assigned by TeamCity changes occasionally which requires me to change the “Source path” in 30+ Octopus deploy “Pack” steps.

Last week, one of my projects had a SourcePath: E:\TeamCity_BuildAgent\work\1ece97050dfca7f4
Now it is E:\TeamCity_BuildAgent\work\311d5574ebb6591

Hi @gelgin,

Thanks for getting in touch with us over your question.

You should be able to reference the TeamCity working directory using %system.teamcity.build.workingDir% (or the shortened version %teamcity.build.workingDir% ), and hopefully that’s what you’re after. The following stack overflow link may also be helpful: parameters - Where does TeamCity get the value for %system.teamcity.build.workingDir% - Stack Overflow

I hope that frees you from having to change the source paths manually, but please let us know if this is helpful.

Best,
Patrick

Excellent. That worked Patrick! Thanks for your help.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.