This is based on the NAnt version I made, with some added improvements. Since I wrote the NAnt script I have moved from Windows to Mac. So the NAnt script is no longer useful and Rake means it can run multi platform.
Why Do You Need One
If you’re an agile developer, you’ll be showing your app to your client regularly, in order to get feedback and iterate. Having an automated packaging solution ensures you can package your app quickly, easily, consistently and without mistakes. By being quick and easy it lowers the barrier to deploy often.
The best way to show your app to clients is to have your own custom repository. If you don’t have one, you can still use this script to package your apps for the official Boxee App Library.
What Does it Do
It packages your app into the Boxee zip file format, for each specified repository environment. You can specify as many environments as you wish. I usually specify 2, my staging repository (which clients use to see the apps) and the official boxee repository.
- Packages the app into a zip file, in the right structure, ready for deployment
- Strips out unwanted files (.svn, .git, thumbs.db, Eclipse projects files etc)
- Automatically removes the test-app tag
- Version management automatically increments the version of your app, embeds the version into your descriptor file and appends to packaged zip
- Keeps an audit trail of packaged apps, in case you need to go back to a deployed version
- Allows you to easily identify between the different flavours of your app in Boxee. Eg The one your developing locally, the version in the staging repository and the version in the official Boxee repository.
Why does it package the app for each environment at the same time? When the client is happy with the app that they see in your staging repo. You can then deploy exactly the same app you have just shown them to the Boxee repo. No room for mistakes.
You can either clone the Boxee Boilerplate repo (more to come on this) if you’re starting a new app or copy the build folder to your current app directory.
You’ll need Ruby, Rake and bundler installed (gem install rake, gem install bundler) to run this script.
From a terminal run the following, to install the gems the script depends on.
cd build bundle install
One Time Configuration
Open build/environments.yml and fill in the blanks. Give the app flavours different names or logos, so you can distinguish between them when they are listed in Boxee App Library. You can also add any other descriptor properties you want for an environment.
From a terminal:
cd build rake
This will create the packages under build/packages directory.
Any problems, let me know.