From 2c0000b8cc728a3962bbdb657bf377f71025ec3a Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 20 Sep 2013 23:13:30 -0300 Subject: [PATCH] Clean up after ourselves when building base boxes --- boxes/build-debian-box.sh | 9 ++++++++- boxes/build-ubuntu-box.sh | 10 +++++++++- boxes/common/install-babushka | 2 ++ boxes/common/install-chef | 2 ++ boxes/common/install-puppet | 2 ++ boxes/common/install-salt | 2 ++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/boxes/build-debian-box.sh b/boxes/build-debian-box.sh index 751142a..597ddd3 100755 --- a/boxes/build-debian-box.sh +++ b/boxes/build-debian-box.sh @@ -157,4 +157,11 @@ sed -i "s//${NOW}/" metadata.json # Vagrant box! tar -czf $PKG ./* -echo "The base box was built successfully to ${WORKING_DIR}/${PKG}" +chmod +rw ${WORKING_DIR}/${PKG} +mkdir -p ${CWD}/output +mv ${WORKING_DIR}/${PKG} ${CWD}/output + +# Clean up after ourselves +rm -rf ${WORKING_DIR} + +echo "The base box was built successfully to ${CWD}/output/${PKG}" diff --git a/boxes/build-ubuntu-box.sh b/boxes/build-ubuntu-box.sh index 6d58fdf..dd72def 100755 --- a/boxes/build-ubuntu-box.sh +++ b/boxes/build-ubuntu-box.sh @@ -140,4 +140,12 @@ sed -i "s//${NOW}/" metadata.json # Vagrant box! tar -czf $PKG ./* -echo "The base box was built successfully to ${WORKING_DIR}/${PKG}" +chmod +rw ${WORKING_DIR}/${PKG} +mkdir -p ${CWD}/output +mv ${WORKING_DIR}/${PKG} ${CWD}/output + +# Clean up after ourselves +rm -rf ${WORKING_DIR} +lxc-destroy -n ${RELEASE}-base + +echo "The base box was built successfully to ${CWD}/output/${PKG}" diff --git a/boxes/common/install-babushka b/boxes/common/install-babushka index 6d43d76..a770bbb 100755 --- a/boxes/common/install-babushka +++ b/boxes/common/install-babushka @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rootfs=$1 echo "installing babushka" diff --git a/boxes/common/install-chef b/boxes/common/install-chef index d99d0d7..2eeda2f 100755 --- a/boxes/common/install-chef +++ b/boxes/common/install-chef @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rootfs=$1 echo "installing chef" diff --git a/boxes/common/install-puppet b/boxes/common/install-puppet index 1e1650e..d159d4f 100755 --- a/boxes/common/install-puppet +++ b/boxes/common/install-puppet @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rootfs=$1 echo "installing puppet" diff --git a/boxes/common/install-salt b/boxes/common/install-salt index e7f74a2..b982117 100755 --- a/boxes/common/install-salt +++ b/boxes/common/install-salt @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rootfs=$1 echo "installing salt"