#!/bin/bash -e # Get current verison number version=`cat VERSION` # Enssure we are on master branch git checkout master # Generate documentation make doc (cd doc/scripts && asciidoc index.txt) git add doc/scripts/index.html git commit -m "Update doc index" # Checkout gh-pages git checkout gh-pages git pull # Create doc folder if it does not exists mkdir -p ./$version # Copy doc to the right locations git show master:doc/scripts/index.html &> index.html cp -r _build/default/_doc/_html/* ./$version/ # Add potentially new pages git add ./$version git add ./index.html # Commit it all & push git commit -m "Doc release $version" git push # Get back to master branch git checkout master