Files
computer-playbook/scripts/install/all.sh
T
kevinveenbirkenbachandClaude Opus 4.7 197f5ee059 chore(install): chmod 0777 the install stamp file, not just its dir
The stamp_dir already gets 0777 so any uid can land the stamp on a
shared host, but `touch ${STAMP}` requires write access to the file
itself. When the first run was sandboxed (uid 65534) and the second is
the real user, the second touch failed and pre-commit's `make test`
re-triggered a full `make install`. Matching the dir's permissions on
the file closes that gap.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 20:57:59 +02:00

58 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}"
chmod 0777 "${STAMP}" 2>/dev/null || true