On the new project in work the team took a decision to move from NAnt to Rake, we’d got to a very mature state with our NAnt Build/Deployment scripts but we were finding it difficult to do more programmatic tasks e.g. for loops! This prompted our move to Rake as we could then write pure Ruby when needed, hopefully get more reuse from already existing gems and our code!
So how did the move go?
Very well thanks!
- Its much easier than writing NAnt and using RubyMine as our IDE helps a lot.
- We’ve bin following the best practice we learnt from our NAnt scripts, in most cases implementing the simple task is much the same but Rake/Ruby make the complex tasks much easier to write and maintain
- Rake gives more scope around deployments there’s tools like Chef and Puppet which use Ruby, I’m excited to see were we go in this space.
Gems we used:
We’ve written four helper classes:
- template.rb – used to wrap erb
- file.rb – extend the Ruby file class so that the expand_path method works for windows
- iis.rb – used to wrap the appcmd calls for iis there is a ruby gem out there call inetmgr
- robocopy.rb – this is the article we followed to create our class here
In the long run were going to try and write our own gems and release them for anything we’ve done we can’t find a gem for already we’ll see how it goes!