feat: integrate environment configuration into development workflow
- Auto-create .env file from template during setup-dev - Add validate-config target to Makefile for configuration validation - Update check-uv.sh to use environment variable for GitHub URL - Provide helpful setup messages and next steps for developers
This commit is contained in:
17
Makefile
17
Makefile
@@ -4,7 +4,7 @@
|
||||
.PHONY: help install install-dev clean test test-cov lint format type-check
|
||||
.PHONY: server cli demo docker-build docker-dev docker-prod docker-test
|
||||
.PHONY: pre-commit setup-dev deps-update deps-check security-check
|
||||
.PHONY: build package publish docs release
|
||||
.PHONY: build package publish docs release validate-config
|
||||
|
||||
# Default target
|
||||
.DEFAULT_GOAL := help
|
||||
@@ -48,6 +48,11 @@ setup-dev: check-uv ## Set up development environment with uv
|
||||
uv venv --python python3
|
||||
$(call success,Virtual environment created)
|
||||
@$(MAKE) install-dev
|
||||
@if [ ! -f ".env" ] && [ -f ".env.example" ]; then \
|
||||
echo -e "$(BLUE)$(INFO_SYMBOL)$(NC) Creating .env file from template..."; \
|
||||
cp .env.example .env; \
|
||||
echo -e "$(GREEN)$(SUCCESS_SYMBOL)$(NC) .env file created. Please review and customize the settings."; \
|
||||
fi
|
||||
@if [ -f ".pre-commit-config.yaml" ]; then \
|
||||
echo -e "$(BLUE)$(INFO_SYMBOL)$(NC) Installing pre-commit hooks..."; \
|
||||
. $(VENV_PATH)/bin/activate && pre-commit install; \
|
||||
@@ -196,13 +201,21 @@ cli: ## Run CLI with help
|
||||
fi
|
||||
|
||||
demo: ## Run interactive demo
|
||||
$(call info,Starting interactive demo...)
|
||||
$(call header,UnitForge Demo)
|
||||
@if [ -f "$(VENV_PATH)/bin/activate" ]; then \
|
||||
. $(VENV_PATH)/bin/activate && ./demo.sh; \
|
||||
else \
|
||||
./demo.sh; \
|
||||
fi
|
||||
|
||||
validate-config: ## Validate environment configuration
|
||||
$(call header,Validating Configuration)
|
||||
@if [ -f "$(VENV_PATH)/bin/activate" ]; then \
|
||||
. $(VENV_PATH)/bin/activate && python scripts/validate_config.py; \
|
||||
else \
|
||||
python3 scripts/validate_config.py; \
|
||||
fi
|
||||
|
||||
# Docker targets
|
||||
docker-build: ## Build Docker images
|
||||
$(call info,Building Docker images...)
|
||||
|
||||
@@ -233,7 +233,7 @@ fi
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}For more information:${NC}"
|
||||
echo -e " ${BLUE}UnitForge: https://github.com/unitforge/unitforge${NC}"
|
||||
echo -e " ${BLUE}UnitForge: ${GITHUB_URL:-https://github.com/will666/unitforge}${NC}"
|
||||
echo -e " ${BLUE}uv docs: https://github.com/astral-sh/uv${NC}"
|
||||
|
||||
# Exit with appropriate code
|
||||
|
||||
Reference in New Issue
Block a user