DevOps Zone is brought to you in partnership with:

My name is Toni Petrina and I am a software developer and an occasional speaker. Although I primarily develop on the Microsoft stack, I like to learn new technologies. My hobbyist projects range from game development, regardless of the technology, to ALM. I spend most of my time with my girlfriend and someday I will learn how to play the guitar properly. Toni is a DZone MVB and is not an employee of DZone and has posted 71 posts at DZone. You can read more from them at their website. View Full User Profile

DevLog: WebMatrix, GitHub, Azure and the Wonders of Continuous Deployment

09.01.2013
| 1433 views |
  • submit to reddit

This weekend I felt like working on my WebGL project again and I was reminded of how dreadful web development can be. Working on files in the wwwroot folder, copy-pasting them back to the local GitHub repository, pushing the changes up, FTPing the files to my host … sigh. There had to be a better way.

And there I was, all I needed was to use the wonderful tools around me. First of all, I created a separate GitHub project for the web part. This way I can separate web code from the C++ converters and general toolchain (the project can be split into two different parts: the WebGL demo player and the C++ code that converts binary files to json files that can be used in the web player).

I knew that there had to be a way to use an arbitrary folder in IIS ... it's called a virtual directory (please stop throwing bottles at me, I am just a newbie at this). Now I can edit files in the folder under source control and I can use localhost/kzplayer/ to test the changes immediately.

Virtual directory wizard

This is so easy… I wish I knew about it before :/

OK, now that I have my files under source control, how do I deploy them? Well, Azure offers up to 10 free websites and you can set up Azure to pull the files from GitHub whenever I push them. This is similar to hooks on your own host, but this works across the web. Awesome, now any push to my master branch gets immediately deployed. Continuous deployment FTW.

Windows Azure Website Continuous deployment page

Awesomeness in action

The final piece of the puzzle was WebMatrix. This is an awesome tool, a lightweight alternative to working in Visual Studio. You can open your folder as your website or you can connect directly to your Azure websites and then modify the files there. If you log in with the same live ID you use to manage Azure websites, it picks them up.

Screenshot of the project open in WebMatrix

Easy editing of all your files

It even picks up the source control and allows you to work with Git straight from the UI instead of going back to Git Shell. All in all, it is cool … but it still lacks lots of Visual Studio's shortcuts, and Ctrl+K,D doesn’t format the documents equally. Also, you don’t have Web Essentials in WebMatrix, but you can always click on the big Visual Studio ribbon button to switch your environment to VS if you feel more comfortable there. For me, WebMatrix is halfway between Notepad++ and Visual Studio.

The setup works great and has shortened my development cycle a lot. Too bad I hadn’t done this sooner, as I have probably wasted a lot of time on syncing things. That Azure and GitHub work together like a charm … wow, this just blows my mind. All Microsoft services should be as easy to integrate with as this scenario makes it.


Published at DZone with permission of Toni Petrina, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)