From 2f3d1c27ce0d3dcd1dc91724f10738af2ccb5400 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 19 Sep 2013 18:41:23 -0300 Subject: [PATCH] Assume that we are running the ubuntu base box builder with a local checkout + add date / time to box metadata.json --- boxes/build-ubuntu-box.sh | 19 +++++++++++++------ boxes/common/metadata.json | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/boxes/build-ubuntu-box.sh b/boxes/build-ubuntu-box.sh index da387aa..1e870de 100755 --- a/boxes/build-ubuntu-box.sh +++ b/boxes/build-ubuntu-box.sh @@ -18,8 +18,6 @@ set -e # TODO: * Add support for flushing cache and specifying a custom base Ubuntu lxc # template instead of system's built in # * Embed vagrant public key -# * Add date to metadata.json -# * Ensure it is in sync with master # * Stuff from locales (rcarmo and discourse stuff) # * Clean up when finished # * Add vagrant-lxc version to base box manifest and create an wiki page @@ -28,9 +26,11 @@ set -e ################################################################################## # 0 - Initial setup and sanity checks +TODAY=$(date -u +"%Y-%m-%d") +NOW="${TODAY} $(date -u +'%H:%M:%S') UTC" RELEASE=${1:-"raring"} ARCH=${2:-"amd64"} -PKG=vagrant-lxc-${RELEASE}-${ARCH}.box +PKG=vagrant-lxc-${RELEASE}-${ARCH}-${TODAY}.box WORKING_DIR=/tmp/vagrant-lxc-${RELEASE} # Providing '1' will enable these tools @@ -39,6 +39,12 @@ PUPPET=${PUPPET:-0} SALT=${SALT:-0} BABUSHKA=${BABUSHKA:-0} +# Path to files bundled with the box +CWD=`readlink -f .` +LXC_TEMPLATE=${CWD}/common/lxc-template +LXC_CONF=${CWD}/common/lxc.conf +METATADA_JSON=${CWD}/common/metadata.json + # Set up a working dir mkdir -p $WORKING_DIR @@ -128,10 +134,11 @@ tar --numeric-owner -czf /tmp/vagrant-lxc-${RELEASE}/rootfs.tar.gz ./rootfs/* # Prepare package contents cd $WORKING_DIR -wget https://raw.github.com/fgrehm/vagrant-lxc/master/boxes/common/lxc-template -wget https://raw.github.com/fgrehm/vagrant-lxc/master/boxes/common/lxc.conf -wget https://raw.github.com/fgrehm/vagrant-lxc/master/boxes/common/metadata.json +cp $LXC_TEMPLATE . +cp $LXC_CONF . +cp $METATADA_JSON . chmod +x lxc-template +sed -i "s//${NOW}/" metadata.json # Vagrant box! tar -czf $PKG ./* diff --git a/boxes/common/metadata.json b/boxes/common/metadata.json index 824c6fd..4ae0cd3 100644 --- a/boxes/common/metadata.json +++ b/boxes/common/metadata.json @@ -1,4 +1,5 @@ { "provider": "lxc", - "version": "3" + "version": "3", + "built-on": "" }