Replace the placeholder ripgrep/fd/bat/fzf set with devops tooling, keeping jq: kubectl, helm, k9s, kubectx/kubens, stern, yq, OpenTofu, and terragrunt — all self-contained, statically linked release binaries in ~/.local/bin, so they persist across Kasm redeploys with no reinstall. Switch idempotency from parsing each tool's --version (kubectl/helm/k9s have no uniform flag) to a version stamp under ~/.local/bin/.versions, and add fetch_arch_deb() for the amd64/arm64 naming most devops tools use. Ansible is Python, not a single binary, so it gets its own module: a venv at ~/.local/opt/ansible with its CLIs symlinked into ~/.local/bin. The guard verifies ansible actually runs (a redeploy can wipe the system python the venv links to) and rebuilds if not. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
# bootstrap.sh — entrypoint for configuring a fresh VM (RHEL-family or
|
|
# Debian-family) with this repo's dotfiles. Safe to re-run.
|
|
#
|
|
# curl -fsSL https://git.nic-oconnor.com/public/dotfiles/raw/branch/main/bootstrap.sh | sh
|
|
# (or, from a checked-out clone: ./bootstrap.sh)
|
|
set -eu
|
|
|
|
REPO_URL="${DOTFILES_REPO:-https://git.nic-oconnor.com/public/dotfiles.git}"
|
|
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}"
|
|
|
|
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
|
|
# When curl-piped into `sh`, there is no checkout on disk: $0 is not a real
|
|
# path, so the module scripts alongside this file are missing. Clone (or
|
|
# update) the repo, then re-exec bootstrap.sh from the checkout.
|
|
if [ ! -f "$SCRIPT_DIR/zsh/install.sh" ]; then
|
|
if ! command -v git >/dev/null 2>&1; then
|
|
echo "bootstrap: git is required to self-clone; install git first" >&2
|
|
exit 1
|
|
fi
|
|
if [ -d "$DOTFILES_DIR/.git" ]; then
|
|
echo "bootstrap: updating existing checkout at $DOTFILES_DIR"
|
|
git -C "$DOTFILES_DIR" pull --ff-only
|
|
else
|
|
echo "bootstrap: cloning $REPO_URL into $DOTFILES_DIR"
|
|
git clone "$REPO_URL" "$DOTFILES_DIR"
|
|
fi
|
|
exec "$DOTFILES_DIR/bootstrap.sh"
|
|
fi
|
|
|
|
"$SCRIPT_DIR/zsh/install.sh"
|
|
"$SCRIPT_DIR/git/install.sh"
|
|
"$SCRIPT_DIR/bin/install.sh"
|
|
"$SCRIPT_DIR/ansible/install.sh"
|