|
|
|
SHELL := /bin/bash |
|
|
|
|
|
COLOR_RESET=\033[0m |
|
COLOR_CYAN=\033[1;36m |
|
COLOR_GREEN=\033[1;32m |
|
|
|
|
|
.PHONY: help install run dev debug app server test clean requirements ci-test ci-quick ci-full |
|
|
|
|
|
.DEFAULT_GOAL := help |
|
|
|
|
|
.SILENT: |
|
|
|
|
|
name := $(word 2,$(MAKECMDGOALS)) |
|
|
|
|
|
help: |
|
@echo "Please use 'make <target>' where <target> is one of the following:" |
|
@echo " help Return this message with usage instructions." |
|
@echo " install Will install the dependencies using Poetry." |
|
@echo " run <folder_name> Runs GPT Engineer on the folder with the given name." |
|
@echo " app Run the main FastAPI application (app.py)" |
|
@echo " dev Run the application in development mode with hot reload" |
|
@echo " debug Run the application in debug mode (no reload)" |
|
@echo " server Run the ASGI server directly with uvicorn" |
|
@echo " ci-test Run CI/CD automated tests" |
|
@echo " ci-quick Run quick CI test (no GitHub Issue)" |
|
@echo " ci-full Run full CI pipeline with GitHub Issue" |
|
@echo " ci-comprehensive Run comprehensive controller tests" |
|
@echo " ci-real-api Run real Gradio API tests" |
|
@echo " test Run all tests" |
|
@echo " requirements Install Python requirements from requirements.txt" |
|
@echo " clean Clean up temporary files and caches" |
|
|
|
|
|
install: poetry-install install-pre-commit farewell |
|
|
|
|
|
poetry-install: |
|
@echo -e "$(COLOR_CYAN)Installing project with Poetry...$(COLOR_RESET)" && \ |
|
poetry install |
|
|
|
|
|
install-pre-commit: |
|
export OPENAI_API_BASE="https://api.groq.com/openai/v1/chat/completions" |
|
export OPENAI_API_KEY="sk-key-from-open-router" |
|
export MODEL_NAME="meta-llama/llama-3-8b-instruct:extended" |
|
export LOCAL_MODEL=true |
|
@echo -e "$(COLOR_CYAN)Installing pre-commit hooks...$(COLOR_RESET)" && \ |
|
poetry run pre-commit install |
|
|
|
|
|
farewell: |
|
@echo -e "$(COLOR_GREEN)All done!$(COLOR_RESET)" |
|
|
|
|
|
|
|
|
|
runs: |
|
@echo -e "$(COLOR_CYAN)Running GPT Engineer on $(COLOR_GREEN)$(name)$(COLOR_CYAN)...$(COLOR_RESET)" |
|
@cd ./gpt-engineer && \ |
|
echo -e "y\ny\ny" | poetry run gpt-engineer "/home/user/app/controllers/$(name)" --model Llama3-70b-8192 --temperature 0.1 |
|
run: |
|
@echo -e "$(COLOR_CYAN)Running GPT Engineer on $(COLOR_GREEN)$(name)$(COLOR_CYAN) folder...$(COLOR_RESET)" && \ |
|
cd ./gpt-engineer && poetry run gpt-engineer /home/user/app/app/Http/controller/$(name) --model Llama3-70b-8192 --temperature 0.1 |
|
|
|
runbabyagi: |
|
cd ./babyagi && python babyagi.py $(name) |
|
|
|
install: |
|
@echo -e "$(COLOR_CYAN)Running GPT Engineer on $(COLOR_GREEN)$(name)$(COLOR_CYAN) folder...$(COLOR_RESET)" && \ |
|
cd ./gpt-engineer && pip install poetry && make install |
|
|
|
|
|
|
|
cloc: |
|
cloc . --exclude-dir=node_modules,dist,build,.mypy_cache,benchmark --exclude-list-file=.gitignore --fullpath --not-match-d='docs/_build' --by-file |
|
|
|
ssh: |
|
ssh-keygen -t rsa -b 4096 \-f ~/.ssh/id_rsa_new |
|
|
|
|
|
app: |
|
@echo -e "$(COLOR_CYAN)Starting FastAPI application...$(COLOR_RESET)" |
|
SPACE_ID="" python app.py |
|
|
|
dev: |
|
@echo -e "$(COLOR_CYAN)Starting application in development mode...$(COLOR_RESET)" |
|
SPACE_ID="" python app.py |
|
|
|
debug: |
|
@echo -e "$(COLOR_CYAN)Starting application in debug mode...$(COLOR_RESET)" |
|
SPACE_ID="" python app.py --debug |
|
|
|
server: |
|
@echo -e "$(COLOR_CYAN)Starting ASGI server directly...$(COLOR_RESET)" |
|
uvicorn mysite.asgi:app --host 0.0.0.0 --port 7860 --reload |
|
|
|
|
|
requirements: |
|
@echo -e "$(COLOR_CYAN)Installing Python requirements...$(COLOR_RESET)" |
|
pip install -r requirements.txt |
|
|
|
|
|
test: |
|
@echo -e "$(COLOR_CYAN)Running tests...$(COLOR_RESET)" |
|
python -m pytest tests/ -v |
|
|
|
|
|
clean: |
|
@echo -e "$(COLOR_CYAN)Cleaning up temporary files...$(COLOR_RESET)" |
|
find . -type f -name "*.pyc" -delete |
|
find . -type d -name "__pycache__" -delete |
|
find . -type d -name "*.egg-info" -exec rm -rf {} + |
|
rm -rf .pytest_cache/ |
|
rm -rf build/ |
|
rm -rf dist/ |
|
|
|
|
|
migrate: |
|
@echo -e "$(COLOR_CYAN)Running database migrations...$(COLOR_RESET)" |
|
python manage.py migrate |
|
|
|
makemigrations: |
|
@echo -e "$(COLOR_CYAN)Creating database migrations...$(COLOR_RESET)" |
|
python manage.py makemigrations |
|
|
|
|
|
docker-build: |
|
@echo -e "$(COLOR_CYAN)Building Docker image...$(COLOR_RESET)" |
|
docker-compose build |
|
|
|
docker-up: |
|
@echo -e "$(COLOR_CYAN)Starting Docker containers...$(COLOR_RESET)" |
|
docker-compose up -d |
|
|
|
docker-down: |
|
@echo -e "$(COLOR_CYAN)Stopping Docker containers...$(COLOR_RESET)" |
|
docker-compose down |
|
|
|
|
|
ci-test: |
|
@echo -e "$(COLOR_CYAN)Running CI/CD automated tests...$(COLOR_RESET)" |
|
chmod +x quick_ci_test.sh |
|
./quick_ci_test.sh |
|
|
|
ci-quick: |
|
@echo -e "$(COLOR_CYAN)Running quick CI test (no GitHub Issue)...$(COLOR_RESET)" |
|
python3 run_complete_ci_pipeline.py --no-github-issue |
|
|
|
ci-full: |
|
@echo -e "$(COLOR_CYAN)Running full CI pipeline with GitHub Issue...$(COLOR_RESET)" |
|
python3 run_complete_ci_pipeline.py |
|
|
|
ci-verbose: |
|
@echo -e "$(COLOR_CYAN)Running CI pipeline with verbose output...$(COLOR_RESET)" |
|
python3 run_complete_ci_pipeline.py --verbose |
|
|
|
ci-comprehensive: |
|
@echo -e "$(COLOR_CYAN)Running comprehensive controller tests...$(COLOR_RESET)" |
|
python3 comprehensive_controller_test.py |
|
|
|
ci-comprehensive-issue: |
|
@echo -e "$(COLOR_CYAN)Running comprehensive tests with GitHub Issue...$(COLOR_RESET)" |
|
python3 run_complete_ci_pipeline.py --comprehensive |
|
|
|
ci-real-api: |
|
@echo -e "$(COLOR_CYAN)Running real Gradio API tests...$(COLOR_RESET)" |
|
python3 real_gradio_api_tester.py |
|
|
|
ci-all: |
|
@echo -e "$(COLOR_CYAN)Running all tests (comprehensive + real API + GitHub Issues)...$(COLOR_RESET)" |
|
python3 run_complete_ci_pipeline.py |