aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build_all_branches_in.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build_all_branches_in.sh')
-rwxr-xr-xscripts/build_all_branches_in.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/build_all_branches_in.sh b/scripts/build_all_branches_in.sh
new file mode 100755
index 0000000..3e56ddd
--- /dev/null
+++ b/scripts/build_all_branches_in.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+INITIAL_FOLDER=${PWD}
+INITIAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+
+if [ -e requirements.txt ]
+then
+ pip install -r requirements.txt
+fi
+if [ -e doc-requirements.txt ]
+then
+ pip install -r doc-requirements.txt
+fi
+if [ -e requirements.txt ]
+then
+ pip install .
+fi
+
+set -x
+# Generating documentation for each other branch in a subdirectory
+for BRANCH in $(git branch --remotes --format '%(refname:lstrip=3)' | grep -Ev '^(HEAD)$'); do
+ echo "*** Building doc for branch ${BRANCH} ***"
+ git checkout $BRANCH
+ cd ${INITIAL_FOLDER}${DOC_PATH}
+ make html
+ mkdir -p ${INITIAL_FOLDER}/public/$BRANCH
+ mv _build/html/ ${INITIAL_FOLDER}/public/$BRANCH
+ rm -rf _build/html/
+ cd ${INITIAL_FOLDER}
+done
+
+# "Develop" is the default branch so we point it as "latest"
+# May/Will change to point master
+ln public/develop public/latest
+
+git checkout $INITIAL_BRANCH