Proper base box cleanup

This commit is contained in:
Fabio Rehm 2013-05-06 10:42:30 -03:00
parent 0e066e7a1c
commit 9a731ec989
2 changed files with 8 additions and 7 deletions

View file

@ -1,10 +1,14 @@
## [0.?.?](https://github.com/fgrehm/vagrant-lxc/compare/v0.3.3...master) (unreleased)
## [0.?.?](https://github.com/fgrehm/vagrant-lxc/compare/v0.3.3...master)
FEATURES:
- Support for building Debian boxes (tks to @Val)
- Support for installing babushka on base boxes (tks to @Val)
IMPROVEMENTS:
- Clean up base boxes files after they've been configured, resulting in smaller packages
## [0.3.3](https://github.com/fgrehm/vagrant-lxc/compare/v0.3.2...v0.3.3) (April 23, 2013)
BUG FIXES:

View file

@ -1,3 +1,4 @@
require 'pathname'
require 'rake/tasklib'
class BuildGenericBoxTask < ::Rake::TaskLib
@ -55,7 +56,7 @@ class BuildGenericBoxTask < ::Rake::TaskLib
download
install_cfg_engines
prepare_package_contents pwd
cleanup
sh 'sudo rm -rf rootfs'
sh "tar -czf tmp-package.box ./*"
end
@ -93,6 +94,7 @@ class BuildGenericBoxTask < ::Rake::TaskLib
end
def prepare_package_contents(pwd)
run 'cleanup'
sh 'sudo rm -f rootfs.tar.gz'
sh 'sudo tar --numeric-owner -czf rootfs.tar.gz ./rootfs/*'
sh "sudo chown #{ENV['USER']}:#{ENV['USER']} rootfs.tar.gz"
@ -106,11 +108,6 @@ class BuildGenericBoxTask < ::Rake::TaskLib
metadata.gsub!('RELEASE', @release)
File.open('metadata.json', 'w') { |f| f.print metadata }
end
def cleanup
run 'cleanup'
sh 'sudo rm -rf rootfs'
end
end
class BuildDebianBoxTask < BuildGenericBoxTask