-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 1.36 KB
/
Makefile
File metadata and controls
41 lines (29 loc) · 1.36 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
DOCKER_COMPOSE := docker compose
SERVICE := app
CONTAINER_FRONT_DIR := /app
CONTAINER_TAURI_DIR := /app/src-tauri
.PHONY: install start stop test-front test-back test docker-up docker-down shell dev git-hooks
# Build de l'image et démarrage du service, puis installation des deps dans le volume monté
install: docker-up git-hooks
$(DOCKER_COMPOSE) exec $(SERVICE) bash -c "cd $(CONTAINER_FRONT_DIR) && npm install && cd $(CONTAINER_TAURI_DIR) && cargo fetch || true"
# Configure les hooks git pour utiliser .githooks (dans ce dépôt uniquement)
git-hooks:
@git config core.hooksPath .githooks
# Démarrer Tauri dans Docker avec X11 forwarding (WSLg)
start: docker-up
$(DOCKER_COMPOSE) exec $(SERVICE) bash -c "cd $(CONTAINER_TAURI_DIR) && cargo tauri dev"
# Démarrer uniquement Vite dans Docker (pour tester le front sans Tauri)
dev: docker-up
$(DOCKER_COMPOSE) exec $(SERVICE) bash -c "cd $(CONTAINER_FRONT_DIR) && npm run dev -- --host 0.0.0.0"
stop: docker-down
docker-up:
$(DOCKER_COMPOSE) up -d --build
docker-down:
$(DOCKER_COMPOSE) down || true
shell:
$(DOCKER_COMPOSE) run --rm $(SERVICE) bash
test-front:
$(DOCKER_COMPOSE) run --rm $(SERVICE) bash -c "cd $(CONTAINER_FRONT_DIR) && npm test"
test-back:
$(DOCKER_COMPOSE) run --rm $(SERVICE) bash -c "cd $(CONTAINER_TAURI_DIR) && cargo test"
test: test-front test-back