Assume that we are running the ubuntu base box builder with a local checkout + add date / time to box metadata.json

This commit is contained in:
Fabio Rehm 2013-09-19 18:41:23 -03:00
parent 50e82f61b1
commit 2f3d1c27ce
2 changed files with 15 additions and 7 deletions

View file

@ -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/<TODAY>/${NOW}/" metadata.json
# Vagrant box!
tar -czf $PKG ./*

View file

@ -1,4 +1,5 @@
{
"provider": "lxc",
"version": "3"
"version": "3",
"built-on": "<TODAY>"
}