From 629fe7f5835c63906001fe6ad936eccff853865e Mon Sep 17 00:00:00 2001 From: Michael Czechowski Date: Tue, 16 Sep 2025 00:21:03 +0200 Subject: [PATCH] refactor: rename USB-related make commands for better clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename build-usb โ†’ usb-build - Rename flash-usb โ†’ usb-flash - Rename test-usb โ†’ usb-test - Fix duplicate vm target in Makefile - Update README.md and AGENTS.md documentation - Maintain consistent command naming convention This makes the commands more intuitive by grouping USB operations with the 'usb-' prefix, improving developer experience and reducing confusion about command purposes. --- AGENTS.md | 6 +++--- Makefile | 16 ++++++++-------- README.md | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e57d3ed..3cc8c59 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ This file provides guidelines for AI coding agents operating within this reposit ## Build, Lint, and Test Commands -- **Build**: `make build-usb` (Builds the NixOS workshop ISO) +- **Build**: `make usb-build` (Builds the NixOS workshop ISO) - **Local VM**: `make vm` (Starts local VM that simulates USB environment) - **Test**: `make status-cloud` (Health checks for cloud infrastructure) - **Deploy**: `make deploy-cloud` (Deploys 15 VMs to Hetzner Cloud) @@ -42,9 +42,9 @@ This file provides guidelines for AI coding agents operating within this reposit ## Development Workflow -1. Use `make local-vm-run` for local development +1. Use `make vm-run` for local development 2. Test with all 15 containers to match production -3. Use `make build-usb` for workshop USB drives +3. Use `make usb-build` for workshop USB drives 4. Deploy to cloud with `make deploy-cloud` ## General Guidelines diff --git a/Makefile b/Makefile index 22510b6..edbf8c2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -include .env export -.PHONY: help deploy-cloud build-usb flash-usb vm-run vm-build clean status destroy-cloud opencode format +.PHONY: help deploy-cloud usb-build usb-flash usb-test vm-run vm-build clean status destroy-cloud opencode format DOMAIN := $(or $(WORKSHOP_DOMAIN),codecrispi.es) USB_DEVICE := $(or $(USB_DEVICE),/dev/sdX) @@ -16,9 +16,9 @@ help: @echo " make destroy-cloud - Destroy cloud infrastructure" @echo "" @echo "๐Ÿ’พ USB Boot Drive (Single Participant Environment):" - @echo " make build-usb - Build NixOS workshop ISO" - @echo " make flash-usb - Flash ISO to USB drive" - @echo " make test-usb - Test USB environment in QEMU" + @echo " make usb-build - Build NixOS workshop ISO" + @echo " make usb-flash - Flash ISO to USB drive" + @echo " make usb-test - Test USB environment in QEMU" @echo "" @echo "๐Ÿ–ฅ๏ธ Local Development:" @echo " make vm-run - Start local VM (simulates USB environment)" @@ -36,7 +36,7 @@ help: @echo "" @echo "Required: HCLOUD_TOKEN, SSH key at ~/.ssh/id_ed25519.pub" -build-usb: +usb-build: @echo "๐Ÿ”จ Building NixOS workshop ISO..." @if [ ! -f ~/.ssh/id_ed25519.pub ]; then \ echo "โŒ SSH key not found at ~/.ssh/id_ed25519.pub"; \ @@ -47,7 +47,7 @@ build-usb: @echo "โœ… ISO built: $(ISO_FILE)" @echo "๐Ÿ“ฆ Size: $$(du -h $(ISO_FILE) | cut -f1)" -flash-usb: build-usb +usb-flash: usb-build @if [ "$(USB_DEVICE)" = "/dev/sdX" ]; then \ echo "โŒ Set USB_DEVICE=/dev/sdX (find with 'lsblk')"; \ exit 1; \ @@ -59,7 +59,7 @@ flash-usb: build-usb sync @echo "โœ… USB drive ready!" -test-usb: +usb-test: usb-build @echo "๐Ÿงช Testing USB environment in QEMU..." nix develop --command qemu-system-x86_64 \ -cdrom $(ISO_FILE) \ @@ -75,7 +75,7 @@ vm-run: @echo "๐Ÿ–ฅ๏ธ Starting workshop VM as root..." nix run .#local-vm --impure -vm: vm-build +vm-build: @echo "๐Ÿงช Testing VM build as root..." nix build .#local-vm --impure @echo "โœ… VM builds successfully" diff --git a/README.md b/README.md index ad7e704..5dffaf1 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Single-participant learning environments with local practice and cloud deploymen make vm # 2. Build USB drives for participants -make build-usb -make flash-usb USB_DEVICE=/dev/sdX +make usb-build +make usb-flash USB_DEVICE=/dev/sdX # 3. Deploy cloud infrastructure export HCLOUD_TOKEN="your_token" @@ -56,8 +56,8 @@ Pre-configured with: Build and flash: ```bash -make build-usb -make flash-usb USB_DEVICE=/dev/sdb +make usb-build +make usb-flash USB_DEVICE=/dev/sdb ``` ## ๐ŸŒ Cloud Deployment @@ -74,7 +74,7 @@ make status-cloud # Check health ```bash make vm # Start VM (simulates USB environment) -make build-usb # Verify build (builds ISO) +make usb-build # Verify build (builds ISO) ``` The VM simulates the USB experience with identical configuration and commands.