refactor: rename USB-related make commands for better clarity
- 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.
This commit is contained in:
@@ -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
|
||||
|
||||
16
Makefile
16
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"
|
||||
|
||||
10
README.md
10
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.
|
||||
|
||||
Reference in New Issue
Block a user