docs(setup): add Debian 13 dev-VM setup procedure + scripts + devcontainer
CI / commits (pull_request) Successful in 2m52s
CI / check (pull_request) Successful in 3m3s
CI / scan (pull_request) Successful in 3m11s
CI / a11y (pull_request) Successful in 3m5s
Docs site / build (pull_request) Successful in 3m10s
CI / perf (pull_request) Successful in 6m53s
CI / commits (pull_request) Successful in 2m52s
CI / check (pull_request) Successful in 3m3s
CI / scan (pull_request) Successful in 3m11s
CI / a11y (pull_request) Successful in 3m5s
Docs site / build (pull_request) Successful in 3m10s
CI / perf (pull_request) Successful in 6m53s
New procedure in docs/setup/01-dev-debian-vm-setup.md targeting the new dev VM (10.100.201.21, Debian 13) that replaces the WSL workflow. The existing setup files are renumbered (01->02, 02->03, 03->04) to free prefix 01 for the default flow. 10 modular idempotent scripts under docs/setup/scripts/ install the stack: zsh + Oh My Zsh + Powerlevel10k + plugins, modern CLI tooling (bat, eza, fd-find, ripgrep, fzf, zoxide, ncdu, keychain + dev extras), nvm + Node from .nvmrc + corepack + pnpm, Docker CE + compose plugin, inotify watches + swap + hostname tuning, best-effort UFW + sshd hardening that probes-before-applying, and notes/aliases.zsh + notes/gitconfig.txt installation. A systemd template (apf-portal-infra@.service) auto-starts the local dev infra stack at boot per user. .devcontainer/ ships a VSCode Dev Container spec pinning Node 24 and attaching to the host's apf-portal-dev Compose network so postgres / redis / otel resolve by DNS from inside the container. initializeCommand fails fast if the infra hasn't been brought up yet. CLAUDE.md Environment conventions documents the two envs (local + development) plus the hybrid sub-mode (workstation IDE + VM infra via SSH LocalForward) and the two IDE flows (Remote-SSH + Devcontainer). Adjacent follow-ups (not in this PR): preview infra on the GitLab VM (10.100.201.10), GitLab Runner migration alongside the Gitea -> GitLab cutover, private dotfiles repo.
This commit is contained in:
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
# nvm + Node from the repo's .nvmrc + corepack + pnpm at the version pinned
|
||||
# in package.json's packageManager field.
|
||||
set -euo pipefail
|
||||
# shellcheck source=./lib.sh
|
||||
source "$(cd "$(dirname "$0")" && pwd)/lib.sh"
|
||||
require_debian
|
||||
require_not_root
|
||||
|
||||
NVM_VERSION="v0.40.1"
|
||||
NVM_DIR="$HOME/.nvm"
|
||||
|
||||
if [[ -d "$NVM_DIR" ]]; then
|
||||
skip "nvm already installed at $NVM_DIR."
|
||||
else
|
||||
log "Installing nvm $NVM_VERSION."
|
||||
curl -fsSL "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash
|
||||
ok "nvm installed."
|
||||
fi
|
||||
|
||||
# Source nvm so we can use it in this shell.
|
||||
export NVM_DIR
|
||||
# shellcheck disable=SC1091
|
||||
source "$NVM_DIR/nvm.sh"
|
||||
|
||||
# Read .nvmrc from the repo root.
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
|
||||
if [[ -z "$REPO_ROOT" ]]; then
|
||||
err "Run from inside a git checkout of apf_portal (no repo root found)."
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f "$REPO_ROOT/.nvmrc" ]]; then
|
||||
warn "$REPO_ROOT/.nvmrc not found — installing Node LTS as fallback."
|
||||
nvm install --lts
|
||||
nvm alias default 'lts/*'
|
||||
else
|
||||
NODE_VER="$(<"$REPO_ROOT/.nvmrc")"
|
||||
log "Installing Node $NODE_VER (from $REPO_ROOT/.nvmrc)."
|
||||
nvm install "$NODE_VER"
|
||||
nvm alias default "$NODE_VER"
|
||||
ok "Node $(node --version) active."
|
||||
fi
|
||||
|
||||
# corepack — provides pnpm + yarn shims, reads packageManager from package.json.
|
||||
corepack enable
|
||||
ok "corepack enabled."
|
||||
|
||||
# Warm pnpm to download the pinned version.
|
||||
if [[ -f "$REPO_ROOT/package.json" ]]; then
|
||||
pushd "$REPO_ROOT" >/dev/null
|
||||
pnpm --version >/dev/null
|
||||
ok "pnpm $(pnpm --version) ready (from package.json packageManager)."
|
||||
popd >/dev/null
|
||||
fi
|
||||
|
||||
log "Reload your shell (exec zsh -l) so nvm + node + pnpm are on PATH."
|
||||
Reference in New Issue
Block a user