Improved Azure Web Sites ‘Two-Way Sync’ Deployments - More Control of your Remote Production Git Repo

Friday, October 11, 2013 4:52 PM

Yesterday I pushed two blog posts and an article out on how I keep a local copy of my Orchard CMS development projects and then how I deploy these changes to their production hosts using Azure Web Sites and the git source control system:

Everything seemed great but this morning, this nagging thing I’ve been putting up with got the better of me and was determined to crack that nut (fueled by a full pot of coffee after setting a PR pace for a 3.5 mile run). After the posts yesterday, I thought I was leaving some unfinished business lying around, and I just couldn’t let it sit.

Current Challenges

The issues are:

  • Having machine dynamically generated files in my production repository
  • Not having system generated files included in my repository

Both of these stem from the fact you just don’t have the same level of control over your remote repository that you have locally. Referring back to my article, on the production side of things, when you create a git repository using the Azure portal, all the files in your current Azure Web Site are included in the repository. If you are starting with an existing site, that might mean you have log files, index files from search modules or in the case of Orchard CMS, other Orchard generated files.

That accounts for files you don’t want, but what about files generated by your site that you DO want in source control? For example, Orchard is capable of operating in a multitenant capability, effectively hosting multiple sites on the same engine, but each site operating under it’s own URL and having it’s own database. In the codebase of the site, the engine creates a folder for each tenant with a settings.txt file that contains the database and other relevant data for the specific tenant. That file is something I wanted in source control as it isn’t regenerated… think of it as Orchard’s specific web.config.

In this article I’ll show you how I did it… using some pretty slick capabilities with Azure Web Sites!

» HowTo: Improved Azure Web Sites ‘Two-Way Sync’ Deployments - More Control of your Remote Production Git Repo

comments powered by Disqus