From 48d26eb9937f8ab28def3dfed062d7dc0caff9ec Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Tue, 6 Feb 2024 18:27:12 +0000 Subject: [PATCH 1/2] .gitlab-ci.yml: Build all docs in pages Build doc for both preview and main branches --- .gitlab-ci.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1f162d01..803d78e86 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 + -- GitLab From fbd7a2588297f404eb92ed7deac4a8684f50d8d0 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Tue, 6 Feb 2024 18:48:27 +0000 Subject: [PATCH 2/2] shell/lisa_shell: Create git hooks dir FIX If hooks directory does not exist, create it. --- shell/lisa_shell | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/lisa_shell b/shell/lisa_shell index dc1074585..7e7d8b874 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" -- GitLab