In this article I describe how to use them on your workstation, in your Continuous Integration/Delivery server and what parts still need a bit more attention.
What are the goals?
- To be able to set up a new project with as little effort as possible to avoid having any projects that live without CI, because of the lack of time to set it up. To reduce setup time the scripts favor convention over configuration.
- To be able to run all actions equally well from your workstation as from the build server.
What does it automate for you?
The scripts are continuously improving, currently they do quite a lot:
- Versions all your compiled assemblies with parameter BuildVersion, which needs a major.minor.build.revision (18.104.22.1689 for example) version number.
- For both MVC and WebForms applications it compiles them using AspNetCompiler to check for errors in your views.
- Outputs your generated assemblies to a set directory, so solutions can reference assemblies generated by another solution within the same repository.
- Runs tests created with both NUnit and Machine.Specification.
- Runs JMeter tests.
Creating release artifacts
- Compiles Flash with Flex, outputs it to your web project and versions the filename.
- Applies config transforms for any config file (where the original is called [a-z]+.config and the transform [a-z]+.[a-z]+.config).
- Creates artifacts for each environment you have a config transform for.
- Updates filenames with 22.214.171.124 in them to reflect the current build version to avoid caching issues and updates all references to them in css and js.
- Precompiles asp.net websites.
- Removes any files that shouldn't be part of the release.
- Optimizes pngs.
- Optimizes jpegs.
Deploying release artifacts
- Deploys websites using MSDeploy.
- Deploys database projects.
- Deploys data-tier-applications (supported by Azure).
- Deploys Azure packages to staging, then swaps to production and removing staging afterwards; which of these steps is executed can be parameterized.
- Delete Azure instances.
- Analyze code using FXCop.
Which actions are taken for what projects is automatically handled by sticking to the project naming conventions. More about these below.
Read on to learn how the build files are structured, how to use them and how to configure them in your favorite CI server.