Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·51 lines (39 loc) · 1.8 KB
/
Copy pathMakefile
File metadata and controls
executable file
·51 lines (39 loc) · 1.8 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
.PHONY: help build up down restart logs test test-backend test-docker tag push-tags clean
VERSION := $(shell cat VERSION 2>/dev/null || echo "1.0.0")
help:
@echo "=========================================================================="
@echo " FIRMWARE TRACKING - COMMAND MENU (v$(VERSION)) "
@echo "=========================================================================="
@echo " make build - Build Docker images (Backend & Frontend Alpine)"
@echo " make test - Run automated tests (Pytest in Docker container)"
@echo " make test-backend - Run Pytest suite in local Python virtualenv"
@echo " make up - Launch full stack with Docker Compose (-d)"
@echo " make down - Stop and remove running containers"
@echo " make restart - Restart and rebuild all services"
@echo " make logs - Stream live logs from all containers"
@echo " make tag - Create local Git Tag from VERSION file (v$(VERSION))"
@echo " make push-tags - Push Git tags to GitHub to trigger CI/CD pipeline"
@echo " make clean - Clean Pytest caches and temporary build files"
@echo "=========================================================================="
build:
docker-compose build
test: build
docker-compose run --rm backend pytest tests/ -v
test-backend:
cd backend && python -m pytest tests/ -v
up:
docker-compose up -d --build
down:
docker-compose down
restart: down up
logs:
docker-compose logs -f
tag:
@echo "Creating Git Tag v$(VERSION)..."
git tag -a v$(VERSION) -m "Release v$(VERSION)"
push-tags:
git push origin --tags
clean:
docker-compose down -v --remove-orphans
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true