In the Windows World…how should you deploy?

If you are a release engineer, release manager, source control engineer, jack of all trades, or even just a one man shop at some point that question comes to mind.

You need to put these websites you wrote onto a Windows server, but how should you do it?

The answer for a lot of people is simple; i’ll make a Shared Folder (SMB share) and copy the files to it (xcopy, robocopy).

Then they run into issues with IIS running and maybe they write a bat file that disables IIS via WMI, or Entity (in C#), or psexec.

Or maybe you are a windows nut and said MSDeploy will solve all my issues…

If one of these was your answer, or you still can’t think of the answer please feel free to learn from my mistakes.

And then there was configuration management (Puppet and Chef being the forerunners), here is a more comprehensive list from wikipedia: http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software

You might be wondering how is configuration management going to help me do a website deployment, to be honest it is a good question.

With chef you will consume the IIS cookbook, as well as writing some custom recipes. In this recipe, you will want to stop the website you are deploying.  Next, you should download the artifact from the resulting build.  From here it is pretty easy, you are going to unzip (using the windows cookbook) to the wwwroot dir and then start IIS back up.  So from this you can see you are probably going to want some variables.  I’d recommend the following url to artifact, directory, website name.  With these 3 variables you’ll be deploying websites to windows servers, easy and painless.

The chef recipe itself isn’t very complex but when you think about it, this allows any number of webservers in your farm to download the artifact and then deploy the code changes themselves.  All at the same time, now I did say artifacts…bummer right? wrong.  Artifacts are singularly one of the best choices for releases, this allows you to release the same exact code over and over from environment to environment and from server to server.  This means you don’t have some random change that happens because someone made a simple typo.

Anyways, enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s