#!/bin/sh -x
rm -rf aerospike-server
git clone https://github.com/aerospike/aerospike-server.git
( cd aerospike-server && git submodule update --init || true )
( cd aerospike-server && git submodule foreach "(git checkout master; git pull; cd ..; git add '$path')" )
( cd aerospike-server && git submodule update --init )
date=`date '+%Y%m%d'`
tar cvf - --exclude .git aerospike-server | xz -9 >aerospike-$date.tar.xz
rm -rf aerospike-server
