-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
72 lines (55 loc) · 1.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PHONY: build run test clean migrate populate frontend frontend-install frontend-build run-all stop-all frontend-test frontend-lint test-all
# Build the Docker image
build:
docker-compose build
# Run the application
run:
docker-compose up
# Run tests
test:
docker-compose run --rm web pytest
# Clean up Docker resources
clean:
docker-compose down -v
# Run database migrations
migrate:
docker-compose run --rm web flask db upgrade
# Populate the database with sample data
populate:
docker-compose run --rm web python populate_db.py
# Enter the web container shell
shell:
docker-compose run --rm web /bin/bash
# Show logs
logs:
docker-compose logs -f
# Start a PostgreSQL shell
db-shell:
docker-compose exec db psql -U user -d wl_shop_db
# Install frontend dependencies
frontend-install:
cd wl_shop_frontend && npm install -i
# Run frontend development server
frontend:
cd wl_shop_frontend && npm install -i --legacy-peer-deps && npm start
# Build frontend for production
frontend-build:
cd wl_shop_frontend && npm install -i --legacy-peer-deps && npm run build
# Run both backend and frontend
run-all:
docker-compose up -d
$(MAKE) frontend
# Stop both backend and frontend
stop-all:
docker-compose down
pkill -f "npm start"
# Run frontend tests
frontend-test:
cd wl_shop_frontend && npm test
# Lint frontend code
frontend-lint:
cd wl_shop_frontend && npm run lint
# Run all tests (backend and frontend)
test-all:
$(MAKE) test
$(MAKE) frontend-test