Automating Windows Tasks with Capistrano
Posted by Sam
It seems that I've been getting more and more work but my group is still me and one other guy. And the crazy thing is we just keep getting our work done. It seems no matter how much work we get we just keep finding ways to get it done. A big part of this is because of Ruby on Rails and to a lesser extent Solaris.
I discovered Ruby on Rails about 4 years ago and I haven't looked back since. You might be wondering what Ruby on Rails has to do with automating windows tasks. Well that's a good question. Rails is about getting things done and not repeating yourself. There are two types of programmers and system admins. Those that automate and those that don't. If you find yourself doing the same thing more than twice than you should be finding a way to automate it. The Rails community has been driving this since the very beginning and because of this dogged determination to automate and streamline programming and processes several tools have been created to handle this. One of those tools is Capistrano. Capistrano is a great way to run remote tasks on one or a hundred servers. It's relatively easy to use and once you're written your scripts you will save a mountain of time.
Capistrano wasn't written with deploying to Windows server in mind and that's fine. It's open source. You can either create your own tool and make it work for your environment. Fortunately, making it work in Windows is actually quite easy. Basically you need a SSH server and a Unix shell installed on your Windows server. Both tasks can be handled easily by installing copSSH. CopSSH installs OpenSSH and BASH along with several other gnu tools. This is enough for you to start writing Capistrano tasks. In a future post I'll show how to automate some common (for me) windows tasks like creating sites in IIS and creating domain names.
Tags: windows capistrano