This weekend I felt like working on my WebGL project again and I was reminded 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 was, all I needed was to use 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: WebGL demo player and 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 arbitrary folder in IIS – it is called 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 could use
localhost/kzplayer/ to test the changes immediately.
OK, now I have my files under source control, how do I deploy them? Well, Azure offers up to 10 free websites and you can setup Azure to pull the files from the GitHub whenever I push them. Similar like 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.
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 login with the same live ID you use to manage Azure websites, it picks them up.
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 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 shorten my development cycle a lot. Too bad I haven’t done this sooner as I have probably wasted too much 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.