blob: bc02c3f4508187f018c449b6b745a7ad8f0e0900 [file] [log] [blame]
#!/bin/sh -e
#
printUsage() {
echo "Usage : "
echo "./compile.sh SHA1"
echo " SHA1: SHA1 to build (optional)"
exit 1
}
ORIGIN=/origin
DESTINATION=/destination
for arg in "$@"
do
case $arg in
-*)
echo "Invalid option: -$OPTARG"
printUsage
;;
*)
if ! [ -z "$1" ]; then
SHA1=$1
fi
;;
esac
if [ "0" -lt "$#" ]; then
shift
fi
done
if [ -z "$SHA1" ]; then
SHA1=master
fi
# Sources retrieval
git clone $ORIGIN/.
git checkout $SHA1
# Compilation /james-project/src/jekyll/_site
jekyll build --source src/homepage --destination $DESTINATION