dazinator / CrmAdo

An ADO.NET Provider for Dynamics Crm
6 stars 4 forks source link

Adopt Team City for Builds #31

Closed dazinator closed 9 years ago

dazinator commented 9 years ago

Up until now, I have been getting away with not having a build server set up. I have been running all unit tests locally and doing release builds locally.

However this needs to be sorted. I need a stable, automated, high quality build process, one that doesn't rely on me remembering to perform local unit testing and local release builds in order to publish release assets.

So, let's set up CI using Team City.

I will set up 3 different build configurations in Team City.

  1. Triggered on check in, compiles the solution (including .net 4.0 and .net 4.5 targeted compilations) and runs all unit tests. Outputs all release assets (NuGet packages, vsix package, and msi)
  2. Triggered nightly, does all of the above but also runs the Integration tests which are much slower to run)
  3. Triggered manually, does all of the above but also published the release assets to the wider world. I will run this only when ready to release.

After further research I came accross Jake Ginnivens blog entry here: http://jake.ginnivan.net/blog/2014/07/09/my-typical-teamcity-build-setup/

I am going to follow a similar setup, however my release build will generate the release notes and create the Github release and upload the release artifacts to github.

The version numbering strategy I will use for publishing NuGet packages will be "almost" semver - I have documented that here: https://github.com/dazinator/CrmAdo/wiki/NuGet-Package-Versioning-%22Almost-SemVer%22

GitVersion will generate appropriate semver version numbers for my release assets.

dazinator commented 9 years ago

I will create a custom MSBuild file for TeamCity to build the solution with. This is because the build logic is a little tricky as I want to compile the same projects twice targetting different versions of the .net framework each time - .net.40 and .net 45.

Build steps inside MSBuild file are:

Once MSBuild has completed, TeamCity will then run the unit tests:

- CrmAdo.UnitTests (.NET 4.0)
- CrmAdo.UnitTests (.NET 4.5)
- CrmAdo.DdexProvider UnitTests

If unit tests all pass, TeamCity will then:

Create CrmAdo NuGet package:-

Lastly, TeamCity could copy all release assets to a common directory:-

dazinator commented 9 years ago

Team City builds now complete.