Using a build step to set environment variables for the remaining build steps

Hi,
In my company, the development team uses a .bat file (kept in the VCS) to set approximately 30 environment variables.  This sets the general enviroment for then building with ant or running the build products.  Separately, I am setting up TeamCity to do complete builds and run comprehensive tests.  I have manually configured all of the environment variables into the TeamCity project settings.  But, the team is frequently changing the .bat file, so it is a problem to keep the TeamCity project environment variables up to date.

Is it possible to have a build step that can set environment variables that will then be used by the rest of the build steps?

Thanks
-Ray

2 comments
Comment actions Permalink

Hi

In Windows there is setx command to save variables to user or system environment. Such way they are persisted between steps, or even builds.

Michael

0
Comment actions Permalink

Hi Michael,

A much belated thank-you for your suggestion.  I decided finally to go with just setting all of the environment variables using TeamCity build parameters in a build configuration template.  All of my build configurations use that template.  When the developers change the .bat file, they either tell me or we discover it through build failures.

-Ray

0

Please sign in to leave a comment.