Skip to content

Instantly share code, notes, and snippets.

@agazso
Created November 30, 2011 11:03
Show Gist options
  • Save agazso/1408692 to your computer and use it in GitHub Desktop.
Save agazso/1408692 to your computer and use it in GitHub Desktop.
git-check-scaliendb.sh
#!/bin/bash
BRANCH=dev
TARGETS="debug release cli javalib"
if [ "$1" != "" ]; then
BRANCH=$1
fi
function cleanup {
cd ..
rm -rf $TMPDIR
echo "Exiting with status $STATUS"
exit $STATUS
}
cd /tmp
TMPDIR=$(mktemp -d scaliendb.XXXXXX)
git clone git://github.com/scalien/scaliendb.git $TMPDIR
cd $TMPDIR
git checkout $BRANCH
git show 2>&1
echo
grep -rn "//.*EXPERIMENTAL" src
GREP_STATUS=$?
if [ "$GREP_STATUS" = "0" ]; then
echo
echo "ERROR: Experimental code found in source!"
STATUS=1
cleanup
fi
for target in $TARGETS; do
make $target 2>&1
STATUS=$?
if [ "$STATUS" != "0" ]; then
echo
echo "ERROR: Compilation failed!"
break
fi
done
cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment