Files
computer-playbook/scripts/install/all.sh
T
kevinveenbirkenbachandClaude Opus 4.7 dd57167615 fix(install): chmod build/ to 0777 so userns-remapped container shares it
build/ is bind-mounted; under docker userns-remap the container root
maps to host uid 65534 (nobody), so files written from inside the
container are nobody-owned on the host. Whichever side created build/
first locked the other out: a stale nobody-owned build/ blocked the
host touch of build/install.stamp, and a host-owned 0755 build/
blocked the container from writing build/install-lint-<hash>.stamp.

Stamp writers now chmod the build dir to 0777 after creating it. The
first creator wins (only owner can chmod); both writers then place
their own stamps without colliding on directory ownership.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 18:52:42 +02:00

57 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install all runtime dependencies, incremental via a stamp file.
#
# Re-runs the install chain (dev-python bootstrap -> venv -> python -> ansible)
# only when a recipe input is newer than the stamp at build/install.stamp.
# Pass --force (or run `make install-force`) to drop the stamp first.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
cd "${REPO_ROOT}"
STAMP="build/install.stamp"
DEPS=(
pyproject.toml
requirements/requirements.galaxy.yml
requirements/requirements.git.yml
scripts/install/python.sh
scripts/install/ansible.sh
scripts/install/venv.sh
roles/dev-python/files/install.sh
)
if [[ "${1:-}" == "--force" ]]; then
rm -f "${STAMP}"
fi
needs_install=0
if [[ ! -f "${STAMP}" ]]; then
needs_install=1
else
for dep in "${DEPS[@]}"; do
if [[ ! -f "${dep}" ]]; then
echo "[install] missing dependency: ${dep}" >&2
exit 1
fi
if [[ "${dep}" -nt "${STAMP}" ]]; then
needs_install=1
break
fi
done
fi
if [[ "${needs_install}" -eq 0 ]]; then
exit 0
fi
bash roles/dev-python/files/install.sh ensure
bash scripts/install/venv.sh
bash scripts/install/python.sh
ANSIBLE_COLLECTIONS_DIR="${HOME}/.ansible/collections" bash scripts/install/ansible.sh
stamp_dir="$(dirname "${STAMP}")"
mkdir -p "${stamp_dir}"
chmod 0777 "${stamp_dir}" 2>/dev/null || true
touch "${STAMP}"