diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1f162d013e83b0d3c01f211c862429c5855409a..803d78e86ba699c2b8db554fd85bacede9616e8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -132,7 +132,7 @@ Autobranch: lisa_python -m pip freeze --exclude-editable --all | cut -f1 -d '=' > "$packages" lisa_python -m pip install --upgrade -r "$packages" - lisa_python -m pip install pip-audit ./tools/lisa-combine-gitlab-mr + lisa_python -m pip install --upgrade pip-audit ./tools/lisa-combine-gitlab-mr pip-audit || exit 1 function update_branch() { @@ -204,6 +204,36 @@ pages: - sudo ./install_base.sh --install-doc-extras - source init_env - | + function lisa_python() { + "$LISA_PYTHON" "$@" + } + set -e - cd doc/ - sphinx-build -b html . "public/$CI_COMMIT_REF_NAME" + + # Ensure we have up to date versions of every pre-installed packages + lisa_python -m pip freeze --exclude-editable --all | cut -f1 -d '=' > "$packages" + lisa_python -m pip install --upgrade -r "$packages" + + lisa_python -m pip install --upgrade pip-audit + pip-audit || exit 1 + + - | + # Avoid using /tmp since it's probably in tmpfs and would consume RAM + export TMPDIR=$(readlink -f .)/tmp + mkdir -p "$TMPDIR" + out="$(readlink -f .)/doc/public" + + + fn build_branch() { + local branch=$1 + local worktree=$(mktemp -d) + git worktree add "$worktree" --checkout "$branch" + + sphinx-build -b html -n --no-color -W --keep-going -T -j auto "$worktree" "$out/$branch" + } + + git fetch --tags + + build_branch main + build_branch preview + diff --git a/shell/lisa_shell b/shell/lisa_shell index dc1074585385b3b10a520330d8ed92690a6bfc25..7e7d8b874a50dcfa16eeb1c18d104fb245544fd3 100755 --- a/shell/lisa_shell +++ b/shell/lisa_shell @@ -215,6 +215,7 @@ function _lisa-copy-git-hook { # Avoid overriding existing hooks unless they are provided by LISA if [[ ! -e "$dst" ]] || grep -q 'LISA-HOOK' "$dst"; then + mkdir -p "$(basename "$dst")" && cp -v "$src" "$dst" else echo "WARNING: Could not install git hook, as it is user-provided: $src => $dst"