Files
hnh-map/Makefile
Nikolay Tatarinov 761fbaed55 Refactor Docker and Makefile configurations for improved build processes
- Updated docker-compose.tools.yml to mount source code at /src and set working directory for backend tools, ensuring proper Go module caching.
- Modified Dockerfile.tools to install the latest golangci-lint version compatible with Go 1.24 and adjusted working directory for build-time operations.
- Enhanced Makefile to build backend tools before running tests and linting, ensuring dependencies are up-to-date and improving overall workflow efficiency.
- Refactored test and handler files to include error handling for database operations, enhancing reliability and debugging capabilities.
2026-03-04 13:59:00 +03:00

40 lines
1.3 KiB
Makefile

.PHONY: dev build test test-backend test-frontend lint fmt generate-frontend clean
TOOLS_COMPOSE = docker compose -f docker-compose.tools.yml
dev:
docker compose -f docker-compose.dev.yml up --build
build:
docker compose -f docker-compose.prod.yml build --no-cache
test: test-backend test-frontend
test-backend:
$(TOOLS_COMPOSE) build backend-tools
$(TOOLS_COMPOSE) run --rm backend-tools sh -c "go mod download && go test ./..."
test-frontend:
$(TOOLS_COMPOSE) build frontend-tools
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm test"
lint:
$(TOOLS_COMPOSE) build backend-tools
$(TOOLS_COMPOSE) build frontend-tools
$(TOOLS_COMPOSE) run --rm backend-tools sh -c "go mod download && golangci-lint run"
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm run lint"
fmt:
$(TOOLS_COMPOSE) build backend-tools
$(TOOLS_COMPOSE) build frontend-tools
$(TOOLS_COMPOSE) run --rm backend-tools sh -c "go mod download && go fmt ./..."
$(TOOLS_COMPOSE) run --rm frontend-tools sh -c "npm ci && npm run format"
generate-frontend:
npm --prefix frontend-nuxt run generate
rm -rf frontend/*
cp -a frontend-nuxt/.output/public/. frontend/
clean:
rm -rf frontend-nuxt/.nuxt frontend-nuxt/.output frontend-nuxt/.cache hnh-map