in Continuous Delivery

Host your ASP.NET application in AppHarbor

AppHarbor is a .NET platform as a Service hosted in cloud in other words you can build your .NET solutions in cloud. Prices start from free. My example will use all free features, but if you want to go pro and keep your continuous deployment infrastructure in cloud, AppHarbor can be a good choice.

In terms of integration with code repositories, AppHarbor supports Bitbucket, Codeplex and GitHub. It’s time to learn Git, so I will use a GitHub repository.

AppHarbor allows you to add multiple add-ons into your app, starting from free but also subscriptions. Add-ons categories are: databases (including MSSQL), email, monitoring, queue (message queues).

I will be using a blank ASP.NET MVC application. Source code can be found at https://github.com/mitasoft/build-example-aspnet-mvc.

Basic app deployment

Create a new application in AppHarbor and integrate it with GitHub repository. Go to Settings, disable precompilation, choose the branch you want to build (I use master branch). In few minutes build process should be done, click Deploy (besides the Build) and then wait for the app to load. Check the recording below to see the steps in action.
Each commit in the repository will trigger an automatic build and deploy in AppHarbor. Cool. 

app-harbor-config

Run unit tests

AppHarbor at the moment of writing this post, offer support for the following testing frameworks:

  • MbUnit (2.4.0.0 – 2.4.2.175)
  • MSTest
  • NUnit (2.4.8.0, 2.5.0.0 – 2.5.3.9345 and 2.5.4.0 – 2.5.9.10348)
  • xUnit.net (1.1.0 – 1.9.1)
  • MSpec (0.5.8.0 and 0.5.12.0)

Next step is to add XUnit support to app and create few dummy tests. Run Install-Package xunit for DemoApp and create tests to see if AppHarbor will really execute them. Commit is detected by AppHarbor, build process starts and after that tests are run.

ut

SQL Server add-on

AppHarbor allows you to add SQL Server support for your app. You can get a 20 MB database for free. After you install this add-on, click on Go to SQL Server for connection details. Those details can be used in your app for running scripts or add mock data.

image

image

image

image