simpleasm/Makefile
Fam Zheng e465b1cf71 Initial commit: Simple ASM - ARM assembly learning game
10-level progressive game teaching ARM assembly basics:
registers, arithmetic, bitwise ops, memory, branching, loops.
Vue 3 + FastAPI + SQLite with K8s deployment.
2026-04-07 10:17:15 +01:00

28 lines
1.1 KiB
Makefile

APP_NAME = simpleasm
REGISTRY = registry.oci.euphon.net
IMAGE = $(REGISTRY)/$(APP_NAME):latest
.PHONY: dev dev-backend dev-frontend build deploy
dev-backend:
uvicorn backend.main:app --reload --port 8000
dev-frontend:
cd frontend && npm run dev
sync:
rsync -az --exclude node_modules --exclude .git --exclude __pycache__ --exclude '*.db' . oci:/tmp/$(APP_NAME)-build/
build: sync
ssh oci "cd /tmp/$(APP_NAME)-build && docker build -t $(IMAGE) ."
deploy: build
ssh oci "docker push $(IMAGE)"
ssh oci "sudo k3s kubectl apply -f /tmp/$(APP_NAME)-build/deploy/namespace.yaml"
@ssh oci "sudo k3s kubectl get secret regcred -n $(APP_NAME) 2>/dev/null" || \
ssh oci "sudo k3s kubectl get secret regcred -n guitar -o yaml | sed 's/namespace: guitar/namespace: $(APP_NAME)/;/resourceVersion/d;/uid/d;/creationTimestamp/d' | sudo k3s kubectl apply -f -"
ssh oci "sudo k3s kubectl apply -f /tmp/$(APP_NAME)-build/deploy/"
ssh oci "sudo k3s kubectl rollout restart deployment/$(APP_NAME) -n $(APP_NAME)"
ssh oci "sudo k3s kubectl rollout status deployment/$(APP_NAME) -n $(APP_NAME) --timeout=120s"
@echo "Deployed to https://asm.oci.euphon.net"