File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ sudo apt-get update && sudo apt-get install -y graphviz libsasl2-dev libldap2-dev libssl-dev
5+
6+ python -m pip install --upgrade pip
7+ pip install -r requirements_for_docs.txt
8+
9+ git submodule update --init --recursive
10+
11+ DEFAULT_BRANCH=" stable"
12+ CURRENT_BRANCH=" ${CF_PAGES_BRANCH:- $DEFAULT_BRANCH } "
13+ SAFE_BRANCH=$( echo " ${CURRENT_BRANCH} " | sed ' s/[^a-zA-Z0-9._-]/-/g' | cut -c1-50)
14+
15+ if [ " ${CURRENT_BRANCH} " = " ${DEFAULT_BRANCH} " ]; then
16+ export DOCS_VERSION=stable
17+ export DOCS_BASEURL=https://docs.openspp.org/
18+ export IS_PREVIEW=0
19+ else
20+ export DOCS_VERSION=" ${SAFE_BRANCH} "
21+ if [ -n " ${CF_PAGES_URL:- } " ]; then
22+ export DOCS_BASEURL=" ${CF_PAGES_URL%/ } /"
23+ else
24+ export DOCS_BASEURL=" https://docs.openspp.org/previews/${SAFE_BRANCH} /"
25+ fi
26+ export IS_PREVIEW=1
27+ fi
28+
29+ sphinx-build -b html docs docs/_build/html
30+ cp docs/_static/_redirects docs/_build/html/_redirects || true
You can’t perform that action at this time.
0 commit comments