2013-03-02 15:26:19 +00:00
|
|
|
namespace :boxes do
|
2013-03-08 04:42:31 +00:00
|
|
|
namespace :quantal64 do
|
2013-03-07 04:58:34 +00:00
|
|
|
desc 'Build Ubuntu Quantal 64 bits Vagrant LXC box'
|
2013-03-08 04:42:31 +00:00
|
|
|
task :build do
|
|
|
|
if File.exists?('./boxes/output/lxc-quantal64.box')
|
|
|
|
puts 'Box has been built already!'
|
|
|
|
exit 1
|
2013-03-07 01:43:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
sh 'mkdir -p boxes/output'
|
2013-03-08 04:42:31 +00:00
|
|
|
sh 'cd boxes/quantal64 && sudo ./download-ubuntu'
|
|
|
|
sh 'rm -f boxes/quantal64/rootfs.tar.gz'
|
2013-04-05 01:02:20 +00:00
|
|
|
sh 'cd boxes/quantal64 && sudo tar --numeric-owner -czf rootfs.tar.gz ./rootfs/*'
|
2013-03-07 04:58:34 +00:00
|
|
|
sh "cd boxes/quantal64 && sudo chown #{ENV['USER']}:#{ENV['USER']} rootfs.tar.gz && tar -czf ../output/lxc-quantal64.box ./* --exclude=rootfs-amd64 --exclude=download-ubuntu"
|
2013-03-27 01:05:41 +00:00
|
|
|
sh 'cd boxes/quantal64 && sudo rm -rf rootfs-amd64'
|
2013-03-07 01:43:52 +00:00
|
|
|
end
|
2013-03-02 15:26:19 +00:00
|
|
|
end
|
|
|
|
end
|