-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (81 loc) · 2.94 KB
/
Makefile
File metadata and controls
98 lines (81 loc) · 2.94 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# SeedSync Makefile - Docker Only
# Simplified build system for containerized deployment
.PHONY: all build build-fresh run stop logs clean test test-image test-e2e test-e2e-headed test-e2e-report size shell help
# Default target
all: build
# Build the Docker image
build:
docker compose -f docker-compose.dev.yml build
# Build without cache
build-fresh:
docker compose -f docker-compose.dev.yml build --no-cache
# Run the container
run:
docker compose -f docker-compose.dev.yml up -d
# Stop the container
stop:
docker compose -f docker-compose.dev.yml down
# View logs
logs:
docker compose -f docker-compose.dev.yml logs -f
# Clean up
clean:
docker compose -f docker-compose.dev.yml down -v --rmi local
rm -rf build/
# Build cached test image (first run only)
test-image:
docker build -t seedsync-test -f src/docker/build/test-image/Dockerfile .
# Run Python tests (in container with runtime dependencies)
test:
$(MAKE) test-image
docker run --rm -v $(PWD)/src/python:/app/python seedsync-test \
pytest tests/unittests -v --tb=short
# Run Playwright E2E tests with a throwaway Docker container
test-e2e-docker:
@docker rm -f seedsync-e2e-test 2>/dev/null || true
docker run -d --name seedsync-e2e-test -p 8801:8800 -e SEEDSYNC_DISABLE_RATE_LIMIT=1 ghcr.io/nitrobass24/seedsync:latest
@echo "Waiting for container to start..."
@for i in $$(seq 1 30); do \
curl -sf http://localhost:8801/ > /dev/null 2>&1 && break; \
sleep 1; \
done
cd src/e2e-playwright && BASE_URL=http://localhost:8801 npx playwright test; \
exit_code=$$?; \
docker rm -f seedsync-e2e-test; \
exit $$exit_code
# Run Playwright E2E tests (headless, requires running container on port 8800)
test-e2e:
cd src/e2e-playwright && npx playwright test
# Run Playwright E2E tests (headed, for debugging)
test-e2e-headed:
cd src/e2e-playwright && npx playwright test --headed
# Show Playwright HTML report
test-e2e-report:
cd src/e2e-playwright && npx playwright show-report
# Show image size
size:
@docker images seedsync-seedsync --format "Image size: {{.Size}}"
# Shell into running container
shell:
docker exec -it seedsync-dev /bin/sh
# Help
help:
@echo "SeedSync Docker Build System"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build - Build Docker image"
@echo " build-fresh - Build Docker image without cache"
@echo " run - Start container"
@echo " stop - Stop container"
@echo " logs - View container logs"
@echo " clean - Remove containers and images"
@echo " test - Run Python unit tests (in Docker)"
@echo " test-image - Build cached test image"
@echo " test-e2e-docker - Run E2E tests inside a fresh Docker container"
@echo " test-e2e - Run Playwright E2E tests (headless)"
@echo " test-e2e-headed - Run E2E tests with browser visible"
@echo " test-e2e-report - Show Playwright HTML report"
@echo " size - Show image size"
@echo " shell - Open shell in running container"