Skip to content

Instantly share code, notes, and snippets.

@jbuchbinder
Last active December 18, 2015 01:59
Show Gist options
  • Save jbuchbinder/5708205 to your computer and use it in GitHub Desktop.
Save jbuchbinder/5708205 to your computer and use it in GitHub Desktop.
build-monitor-core-series.sh
#!/bin/bash
#
# Build all binaries in a series of checkouts.
#
FIRST_TAG=3.5.0
git clone git@github.com:ganglia/monitor-core.git
(
cd monitor-core
echo "Resetting to master position."
git checkout master
git reset --hard
# Get list of all
FIRST_REV=$( git show-ref --tags | grep refs/tags/${FIRST_TAG} | cut -d' ' -f1 )
#echo "FIRST_REV = $FIRST_REV"
REVS=$( git rev-list ${FIRST_REV}...HEAD | tac )
#echo "REVS = $REVS"
for REV in ${REVS}; do
# Figure out datestamp
DS=$( git show --pretty=format:%ad --date=rfc | head -1 )
TS=$( date -d "${DS}" +%s )
echo " --> Building revision $REV (timestamp $TS) <-- "
T="$TS_$REV"
git reset --hard
git checkout "$REV"
./bootstrap && ./configure && make all && ( tar czvf monitor-core-${T}.tar.gz monitor-core )
done
echo "Resetting to master position."
git checkout master
git reset --hard
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment