One Strategy for Continuous Integration with Orchard, Git, Kudu, and MS Azure Websites

This is a poor man's continuous integration solution, for those who don't want to pay for Team City.

TLDR; Fork me on GitHub

Be sure to read the readme on GitHub and/or the rest of this blog post for details. Here is a link to the GitHub repo:

https://github.com/bigfont/orchard-continuous-integration-demo

Prerequisites

  1. Clone the Orchard source.
  2. Keep your company's Orchard work in a Git repository.
  3. Exclude all build results from the repo using .gitignore
  4. Setup continuous deployment from Git to a MS Azure Website.

Lightweight Continuous Integration with Kudu

You can now setup continuous integration using Kudu. Official Kudu documentation explains this; in particular, Deployment Hooks let us generate and customize a deployment script.

Here is a high level view of the steps to setting up CI with Kudu. We're running all scripts from PowerShell with Posh-Git.

Install the Azure command line interface

npm install azure-cli -g

Create an out-of-the-box azure deployment script

azure site deploymentscript --aspWAP Orchard.proj -s src\Orchard.sln

There will now be a .deployment file in your root folder. That file points to a more involved deploy.cmd file. You must edit the deploy.cmd file so that Kudu uses Orchard's build Precompiled targets and build results. Doing so is easier said than done! I suggest using this file as an example.

Once you're done

If you FTP into the /site directory, you will see the following:

deployments (deployment logs and statuses - very useful)
diagnostics
locks
repository (the last checkout of the appropriate repo)
wwwroot (the result of the kudu deploy.cmd; in this case, the build/precompiled)

Gotchas and tips

Validation from the community