From b3f18984a45db842002a081af01ca5e42d45997c Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 8 Mar 2013 01:42:31 -0300 Subject: [PATCH] Rename rake task for building the base quantal64 box and prevent it from running when box has already been built. --- tasks/boxes.rake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/boxes.rake b/tasks/boxes.rake index a93f670..143017e 100644 --- a/tasks/boxes.rake +++ b/tasks/boxes.rake @@ -1,13 +1,15 @@ namespace :boxes do - namespace :build do + namespace :quantal64 do desc 'Build Ubuntu Quantal 64 bits Vagrant LXC box' - task 'quantal64' do - unless File.exists?('./boxes/quantal64/rootfs-amd64') - sh 'cd boxes/quantal64 && ./download-ubuntu' + task :build do + if File.exists?('./boxes/output/lxc-quantal64.box') + puts 'Box has been built already!' + exit 1 end sh 'mkdir -p boxes/output' - sh 'sudo rm -f output/lxc-quantal64.box boxes/quantal64/rootfs.tar.gz' + sh 'cd boxes/quantal64 && sudo ./download-ubuntu' + sh 'rm -f boxes/quantal64/rootfs.tar.gz' sh 'cd boxes/quantal64 && sudo tar --numeric-owner -czf rootfs.tar.gz ./rootfs-amd64/*' 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" end