/Rakefile

http://github.com/dysinger/chef-box · Rakefile · 22 lines · 19 code · 2 blank · 1 comment · 0 complexity · 27629e23f2d6f6a2e63b5d0ed2c91af2 MD5 · raw file

  1. #-*- mode: ruby; -*-
  2. namespace :box do
  3. [ :lucid, :maverick, :natty ].each do |release|
  4. [ 32, 64 ].each do |architecture|
  5. flavor = "#{release}#{architecture}"
  6. ( @flavors ||= [] ) << flavor
  7. desc "Build #{flavor}"
  8. task flavor do
  9. begin sh "rm -f #{flavor}.box" ; rescue ; end
  10. [ :build, :export, :destroy ].each do |command|
  11. sh "bundle exec vagrant basebox #{command} #{flavor}"
  12. end
  13. begin sh "bundle exec vagrant box remove #{flavor}" ; rescue ; end
  14. sh "bundle exec vagrant box add #{flavor} #{flavor}.box"
  15. end
  16. end
  17. end
  18. desc "Build all"
  19. task :all => @flavors
  20. end