sudo apt-get install openscad
mkdir -p ~/dev/openflexure_microscope_builds/sparse_checkout/
cd ~/dev/openflexure_microscope_builds/sparse_checkout/
git init
git config core.sparsecheckout true
echo openscad/ >> .git/info/sparse-checkout
echo generate_makefile.py >> .git/info/sparse-checkout
git remote add -f origin https://github.com/rwb27/openflexure_microscope.git
git pull origin reversed_cantilevered_objective_mount
This did seem to get the latest version, and only the openscad folder. However, it still downloaded about 400Mb of archives!! Is there really that much history there?
python generate_makefile.py
mkdir builds
make all
To rebuild I guess it's even simpler:
#!/bin/bash
# Rebuild the openflexure microscope
cd ~rwb34/dev/openflexure_microscope_builds/sparse_checkout/
git pull
commit=`git rev-parse --verify HEAD`
builds_dir=../commits
if [ -d "$builds_dir/$commit" ]; then
git checkout $commit
rm -rf builds
mkdir builds
make all
mv builds "$builds/$commit"
fi
I've updated the build script somewhat in ./rebuild.sh
and now simply running ./rebuild.sh origin/master
should do the right thing. It will archive old builds by their SHA1, and keep a symlink to the latest one. Next step is some sort of tiny webserver to serve up said folders based on some Git metadata.