Просмотр исходного кода

dynamic Go version, unpin golangci-lint, add AGENTS.md

chach 2 недель назад
Родитель
Сommit
d33b2b1535
3 измененных файлов с 50 добавлено и 3 удалено
  1. 1 1
      00-distro-debian.sh
  2. 3 2
      01-golang.sh
  3. 46 0
      AGENTS.md

+ 1 - 1
00-distro-debian.sh

@@ -4,5 +4,5 @@ set -e
 
 sudo apt update
 sudo apt upgrade -y
-sudo apt install -y git curl build-essential clangd ca-certificates automake
+sudo apt install -y git curl build-essential clangd ca-certificates automake jq
 sudo install -m 0755 -d /etc/apt/keyrings

+ 3 - 2
01-golang.sh

@@ -2,7 +2,8 @@
 
 set -e
 
-curl -L https://go.dev/dl/go1.24.5.linux-amd64.tar.gz -o /tmp/go.tar.gz
+LATEST_GO=$(curl -sL https://go.dev/dl/?mode=json | jq -r '.[0].version')
+curl -L "https://go.dev/dl/${LATEST_GO}.linux-amd64.tar.gz" -o /tmp/go.tar.gz
 mkdir -p "$HOME"/.local
 rm -rf "$HOME"/.local/go
 tar -C "$HOME"/.local -xzf /tmp/go.tar.gz
@@ -15,7 +16,7 @@ go env -w GOPATH="$HOME"/.local/state/go
 go install github.com/go-delve/delve/cmd/dlv@latest
 go install golang.org/x/tools/gopls@latest
 
-curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v2.3.0
+curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b "$(go env GOPATH)/bin"
 go install github.com/nametake/golangci-lint-langserver@latest
 
 

+ 46 - 0
AGENTS.md

@@ -0,0 +1,46 @@
+# bootstrap
+
+Personal dev environment bootstrap for Debian Linux dev workstation setup.
+
+## What this is
+
+Numbered Bash scripts (`[0-9][0-9]-*.sh`) run in order to install and configure a full dev environment: system packages, Docker, Rust/Go/Node toolchains, Helix editor, tmux, LSP servers, CLI tools.
+
+Each script is independently executable and intended to be idempotent.
+
+## Key commands
+
+| Command | Purpose |
+|---|---|
+| `./test.sh` | Build Docker image and run all scripts inside container (smoke test) |
+| `bash -l <script.sh>` | Run a single bootstrap script (needs `-l` for login shell to pick up `~/.bashrc.d/` additions) |
+| `bash docker-test` | Run all `[0-9][0-9]-*.sh` in order (used inside container) |
+
+## Architecture
+
+The numbered prefix defines execution order and implicit dependencies:
+
+| Prefix | Category |
+|---|---|
+| `00-` | System/distro setup (packages via apt) |
+| `01-` | Language runtimes & core tools (bashrc.d, Docker, Go, Node, Rust) |
+| `02-` | Editor & terminal (Helix, just, tmux) — depends on Rust from `01-rust` |
+| `05-` | LSP servers |
+| `10-` | CLI tools (fzf, Rust apps) — depends on Rust from `01-rust` |
+
+- `00-distro-debian.sh` must run first (base packages for everything else).
+- `01-rust.sh` must precede `02-helix.sh`, `02-just.sh`, `10-rust-apps.sh`.
+- `01-bashrc.d.sh` should run early since several scripts add profile fragments to `~/.bashrc.d/`.
+
+## Testing
+
+- `./test.sh` builds `debian:trixie-slim` based Docker image tagged `bootstrap`, then runs `docker-test` inside it.
+- The Docker test runner executes scripts with `bash -l` (login shell) to ensure PATH additions from `~/.bashrc.d/` are active.
+- No unit tests, lint, format, or CI exist.
+
+## Repo conventions
+
+- No `Makefile`, `Justfile`, `.editorconfig`, `.gitignore`, or linter configs.
+- Scripts use `set -e` in the Docker test runner but not necessarily in individual scripts.
+- All scripts install to user home (`~/.local/`, `~/.bashrc.d/`, etc.) — designed per-user, not system-wide.
+- Remote: `ssh://git@source.ramthun.dev:2222/mike/bootstrap.git` (private), branch `master`.