diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c17b42e3e0d5ba668b84212db0b5d706ce26a92..48bf7fa5b6fc984fe5c2f70f0e39816c0a841734 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -242,10 +242,11 @@ pages: out="$(readlink -f .)/public" function build_branch() { - local branch=$1 - local worktree=$(mktemp -d --suffix "-worktree-$branch") - git fetch origin "$branch" - git worktree add "$worktree" --checkout "$branch" + local ref=$1 + local publish_as=$2 + local worktree=$(mktemp -d --suffix "-worktree") + git fetch origin "$ref" + git worktree add "$worktree" --checkout "$ref" ( cd "$worktree" sudo ./install_base.sh --install-doc-extras @@ -257,12 +258,19 @@ pages: audit export LC_ALL=C - local doctree=$(mktemp -d --suffix "-doctree-$branch") - cd ./doc && sphinx-build -b html -n --no-color -W --keep-going -T -j auto -d "$doctree" . "$out/$branch" + local doctree=$(mktemp -d --suffix "-doctree") + cd ./doc && sphinx-build -b html -n --no-color -W --keep-going -T -j auto -d "$doctree" . "$out/$publish_as" ) } - build_branch main - build_branch preview + build_branch main main + build_branch preview preview + + # TODO: For now the release branch doc won't build as it lacks some necessary fixes + # build_branch release + # build_branch v4.0.0 v4 + + # Expose "main" as the "latest" branch + (cd "$out" && ln -s ./main ./latest) # Make the doc a lot more compact by trimming useless files find "$out" '-(' -name '*.ipynb' -or -name '*.ipynb.txt' '-)' -delete @@ -272,8 +280,6 @@ pages: # Rewrite absolute symlinks into relative ones symlinks -cr "$out" - # TODO: For now the release branch doc won't build as it lacks some necessary fixes - # build_branch release # Debug excessive sizes - du -hc "$out" | sort -h diff --git a/tools/check-setuppy b/tools/check-setuppy index 795219f8aff9d395c8e3ccf51c2d0482ed0bca3b..93a9d46f2d16a27d57f8376eef55875895499ec4 100755 --- a/tools/check-setuppy +++ b/tools/check-setuppy @@ -25,7 +25,7 @@ import sys LISA_HOME = os.getenv('LISA_HOME', '.') def call_git(*args): - return subprocess.check_output(('git', *args)).decode('utf-8') + return subprocess.check_output(('git', '-C', LISA_HOME, *args)).decode('utf-8') def get_git_sha1(ref): return call_git('rev-parse', ref).strip()