fix(site): сборка runner переведена со Snap uv на venv
- Зачем: - Snap uv не запускался внутри ограниченного systemd-сервиса без cap_dac_override. - Что: - workflow переведён на постоянный Python venv с pinned requirements. - повторные сборки проверяют зависимости через pip без их переустановки. - Snap удалён из PATH runner, runbook дополнен python3-venv и описанием окружения. - Проверка: - от имени gitea-runner дважды выполнены pip install, pip check и mkdocs build --strict; второй запуск переиспользовал окружение. - обновлённый systemd unit прошёл systemd-analyze verify и успешно перезапущен.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
mkdocs-material==9.6.14
|
||||
mkdocs-same-dir==0.1.3
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
readonly venv_dir="/var/lib/gitea-runner/venvs/site"
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: $0 SOURCE_DIR" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
source_dir=$(realpath "$1")
|
||||
requirements_file="${source_dir}/.gitea/requirements-site.txt"
|
||||
|
||||
if [[ ! -f $requirements_file ]]; then
|
||||
echo "Requirements file not found: ${requirements_file}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$venv_dir")"
|
||||
if [[ ! -x "${venv_dir}/bin/python" ]]; then
|
||||
python3 -m venv "$venv_dir"
|
||||
fi
|
||||
|
||||
"${venv_dir}/bin/python" -m pip install \
|
||||
--disable-pip-version-check \
|
||||
--no-input \
|
||||
--requirement "$requirements_file"
|
||||
"${venv_dir}/bin/python" -m pip check
|
||||
cd "$source_dir"
|
||||
"${venv_dir}/bin/python" -m mkdocs build --strict
|
||||
@@ -31,14 +31,7 @@ jobs:
|
||||
git -C source -c advice.detachedHead=false checkout --detach FETCH_HEAD
|
||||
|
||||
- name: Build the site strictly
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd source
|
||||
uv run \
|
||||
--no-project \
|
||||
--with 'mkdocs-material==9.6.14' \
|
||||
--with 'mkdocs-same-dir==0.1.3' \
|
||||
mkdocs build --strict
|
||||
run: source/.gitea/scripts/build-site.sh source
|
||||
|
||||
- name: Publish the complete release atomically
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user