Files
Esiah 73394dfbbc
CD — Kai-Sa-Cam Deployment / deploy (push) Canceled after 0s
feat: restructure to kai-sa-cam layout with apps/ structure
2026-10-25 01:06:31 +02:00

68 lines
1.7 KiB
Makefile

.DEFAULT_GOAL := help
# Variables
COMPOSE_DEV = docker compose --profile dev
COMPOSE_PROD = docker compose --profile prod
USER_ID ?= 1001
GROUP_ID ?= 1001
APP_DIR ?= /srv/apps/kai-sa-cam
.PHONY: help up-dev down-dev logs-dev build-dev \
up-prod down-prod logs-prod build-prod pull-prod \
status restart clean
help: ## Affiche cette aide
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# --- Développement local ---
up-dev: ## Démarre l'environnement de développement
$(COMPOSE_DEV) up -d --build
down-dev: ## Arrête l'environnement de développement
$(COMPOSE_DEV) down
logs-dev: ## Affiche les logs en continu (dev)
$(COMPOSE_DEV) logs -f --tail 100
build-dev: ## Rebuild les images (dev)
$(COMPOSE_DEV) build
# --- Production (serveur avec runner) ---
up-prod: ## Démarre en production
$(COMPOSE_PROD) up -d
down-prod: ## Arrête la production
$(COMPOSE_PROD) down
logs-prod: ## Affiche les logs (prod)
$(COMPOSE_PROD) logs -f --tail 100
build-prod: ## Build les images de production
$(COMPOSE_PROD) build
pull-prod: ## Pull les images de base
$(COMPOSE_PROD) pull
restart: ## Redémarre les services
$(COMPOSE_PROD) restart
status: ## Affiche l'état des conteneurs
$(COMPOSE_PROD) ps
clean: ## Nettoyage complet
$(COMPOSE_DEV) down --remove-orphans -v
$(COMPOSE_PROD) down --remove-orphans -v
docker image prune -f
# --- Utilitaires ---
logs-cam: ## Logs kai-sa-cam
$(COMPOSE_PROD) logs -f --tail 100 kai-sa-cam
logs-go2rtc: ## Logs kai-sa-go2rtc
$(COMPOSE_PROD) logs -f --tail 100 kai-sa-go2rtc
shell-cam: ## Shell dans kai-sa-cam
$(COMPOSE_PROD) exec kai-sa-cam sh
shell-go2rtc: ## Shell dans kai-sa-go2rtc
$(COMPOSE_PROD) exec kai-sa-go2rtc sh