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:
- Blog Post: Upgrading Orchard CMS from 1.6 to 1.7.1
- Blog Post: HowTo Setup: Orchard CMS Source Enlistment for Local Dev and Automated Git Publishing to Azure
- Article: HowTo Setup: Orchard CMS Source Enlistment for Local Dev and Automated Git Publishing to Azure
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.
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
In this article I'll show you how I did it... using some pretty slick capabilities with Azure Web Sites!