BS-001 Initialize BortStack foundation and project workflow

This commit is contained in:
rob
2026-11-10 14:02:50 +00:00
parent 1ec90a082f
commit 52265961cb
119 changed files with 10298 additions and 64 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -Eeuo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ "$#" -ne 1 || ! "$1" =~ ^(TASK-|BS-)?([0-9]{3})$ ]]; then
echo 'Usage: ./scripts/testtask.sh TASK-XXX (for example: TASK-001)' >&2
exit 2
fi
task="${BASH_REMATCH[2]}"
branch="$(git -C "$root" branch --show-current)"
if [[ -f "$root/.roborto/testtask.conf" && "$branch" == "bs-$task" ]]; then
if ! command -v roborto-testtask >/dev/null 2>&1; then
echo 'testtask: standalone roborto-testtask CLI is missing.' >&2
exit 127
fi
mkdir -p "$root/.test-worktrees"
exec 8>"$root/.test-worktrees/session.lock"
flock -n 8 || { echo 'testtask: another test session is running in this worktree.' >&2; exit 1; }
cd "$root"
exec roborto-testtask "$task"
fi
candidate="$root/.task-worktrees/bs-$task"
if [[ ! -x "$candidate/scripts/testtask.sh" ]]; then
echo "testtask: TASK-$task maps to BS-$task; no prepared task worktree at $candidate" >&2
exit 1
fi
printf 'testtask: TASK-%s -> BS-%s (%s)\n' "$task" "$task" "$candidate"
exec "$candidate/scripts/testtask.sh" "TASK-$task"