I am confused on how and when to use build parameters. I do not understand the difference between Configuration, System, and Environment parameters. I've read the documentation pages on them. For example (from here):
- Environment variables (defined using "env." prefix): are passed into the spawned build process as environment
- System properties (defined using "system." prefix): are passed into the build scripts of the supported runners (e.g. Ant, MSBuild) as build-tool specific variables
- Configuration parameters (no prefix): are not passed into the build and are only meant to share settings within a build configuration. They are the primary means for customization of a build configuration based on a template.
I have fairly simplistic needs. We have a SCM (SVN now, moving to Git later). 99% of the projects are .Net so we're using the msbuild plugin predominantly. I have one build configuration that pulls down the source, complies, and runs unit tests. I have another build config that packages up our code for each environment (dev, qa, prod, etc.). Then I have another build config which will do the deployments, which (for the time being) is just copying the artifacts out to network shares (the user supplies the Build Id in a prompt param). I realize all of that can be more advanced, but like I said, I'm starting simple.
I am just using the default build agent, which is on the same machine as the Team City server. We will probably not have multiple agents for a while.
All of these work fine if I have system and/or environment params for each build config. But I know that's not the most efficient way of doing things, especially when the number of projects and builds grows. So I'm looking at build templates and I'm realizing I don't know when to use which type of param, depsite pouring over the documentation.
What are the rules of thumb? What kind of data should be in config parameters? What kind of data should be in system and environment params? Which kind should prompt the user? Which ones are best practice to pass into the msbuild runner? If params are in a template, can they be overriden? What does the documentaiton mean when it says they "are not passed into a build"? Why does it say system properties "are passed into the build scripts", even though environment variables are, too? Do environment variables change between agents? If so, how? Etc.
See, I'm confused!
Any help appreciated!