PageRenderTime 19ms CodeModel.GetById 2ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

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