mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Sandbox (8→2): consolidate into `make playground` + `playground-down`, add scripts/sandbox.sh wrapper for advanced ops (up/down/shell/reset/ status/logs/bare). Test (7→5): remove test-cover and test-install from Make (still available via scripts directly). Dev Docker (3→2): merge dev-docker-up and dev-docker-watch into `make dev-docker` (defaults to Compose Watch for auto-rebuild), keep dev-docker-down. Update all docs references: README, CLAUDE.md, quick-reference, docker-sandbox guide, ui command page.
101 lines
2.9 KiB
Makefile
101 lines
2.9 KiB
Makefile
.PHONY: help build build-meta run test test-unit test-int test-docker test-docker-online playground playground-down dev-docker dev-docker-down docker-build docker-build-multiarch lint fmt fmt-check check install clean ui-install ui-build ui-dev build-all
|
|
|
|
help:
|
|
@echo "Common tasks:"
|
|
@echo " make build # build binary"
|
|
@echo " make run # run local binary help"
|
|
@echo " make test # unit + integration tests"
|
|
@echo " make test-unit # unit tests only"
|
|
@echo " make test-int # integration tests only"
|
|
@echo " make test-docker # docker offline sandbox (build + unit + integration)"
|
|
@echo " make test-docker-online # docker online install/update tests"
|
|
@echo " make playground # start playground + enter shell (one step)"
|
|
@echo " make playground-down # stop and remove playground"
|
|
@echo " make lint # go vet"
|
|
@echo " make fmt # format Go files"
|
|
@echo " make check # fmt-check + lint + test"
|
|
@echo " make ui-dev # Go API server + Vite dev server (requires local Go)"
|
|
@echo " make dev-docker # Go API in Docker + auto-rebuild (pair with: cd ui && pnpm run dev)"
|
|
@echo " make dev-docker-down # stop dev Docker container"
|
|
@echo " make build-all # ui-build + build"
|
|
@echo " make clean # remove build artifacts"
|
|
@echo ""
|
|
@echo "Advanced (run scripts directly):"
|
|
@echo " ./scripts/sandbox.sh <up|down|shell|reset|status|logs|bare>"
|
|
@echo " ./scripts/test.sh --cover"
|
|
@echo " ./scripts/test_install.sh"
|
|
@echo " docker compose -f docker-compose.sandbox.yml --profile dev up -d # start without watch"
|
|
|
|
build:
|
|
mkdir -p bin && go build -o bin/skillshare ./cmd/skillshare
|
|
|
|
build-meta:
|
|
./scripts/build.sh
|
|
|
|
run: build
|
|
./bin/skillshare --help
|
|
|
|
test:
|
|
./scripts/test.sh
|
|
|
|
test-unit:
|
|
./scripts/test.sh --unit
|
|
|
|
test-int:
|
|
./scripts/test.sh --int
|
|
|
|
test-docker:
|
|
./scripts/test_docker.sh
|
|
|
|
test-docker-online:
|
|
./scripts/test_docker_online.sh
|
|
|
|
playground:
|
|
./scripts/sandbox_playground_up.sh
|
|
./scripts/sandbox_playground_shell.sh
|
|
|
|
playground-down:
|
|
./scripts/sandbox_playground_down.sh
|
|
|
|
dev-docker:
|
|
docker compose -f docker-compose.sandbox.yml --profile dev watch
|
|
|
|
dev-docker-down:
|
|
docker compose -f docker-compose.sandbox.yml --profile dev down
|
|
|
|
docker-build:
|
|
docker build -f docker/production/Dockerfile -t skillshare .
|
|
|
|
docker-build-multiarch:
|
|
docker buildx build --platform linux/amd64,linux/arm64 -f docker/production/Dockerfile -t skillshare .
|
|
|
|
lint:
|
|
go vet ./...
|
|
|
|
fmt:
|
|
gofmt -w ./cmd ./internal ./tests
|
|
|
|
fmt-check:
|
|
test -z "$$(gofmt -l ./cmd ./internal ./tests)"
|
|
|
|
check: fmt-check lint test
|
|
|
|
install:
|
|
go install ./cmd/skillshare
|
|
|
|
ui-install:
|
|
cd ui && pnpm install
|
|
|
|
ui-build: ui-install
|
|
cd ui && pnpm run build
|
|
|
|
ui-dev:
|
|
@trap 'kill 0' EXIT; \
|
|
go run ./cmd/skillshare ui --no-open --host $${SKILLSHARE_UI_HOST:-localhost} & \
|
|
cd ui && pnpm run dev
|
|
|
|
build-all: ui-build build
|
|
|
|
clean:
|
|
rm -rf bin coverage.out
|