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.
Run unit tests
AppHarbor at the moment of writing this post, offer support for the following testing frameworks:
- MbUnit (126.96.36.199 – 188.8.131.52)
- NUnit (184.108.40.206, 220.127.116.11 – 18.104.22.16845 and 22.214.171.124 – 126.96.36.19948)
- 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.
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.