Some checks are pending
CI / Lint bridge (Biome) (push) Waiting to run
CI / Type-check bridge (push) Blocked by required conditions
CI / Tests unit bridge (push) Blocked by required conditions
CI / Tests integration bridge (push) Blocked by required conditions
CI / Security scan (push) Waiting to run
CI / Docker build + healthcheck (push) Blocked by required conditions
- baserow/seed/schema.json : 9 tables declaratif (personne + CFA + Agence) - baserow/seed/seed.py : Python script idempotent (login + workspace + db + tables + fields + links) - baserow/seed/requirements.txt : requests - baserow/seed/README.md : quickstart 4 etapes - Makefile target seed-baserow Fast-App workflow local : - _byan-output/fast-app/formation-hub/ : 6 artifacts (pitch, backlog, cdcf-stories, plan, dispatch, build-state) - Phase 0 mappee : phases 1-6 done depuis docs Merise/UML existants - Iteration 1 BUILD = setup tables Baserow vanilla (S-02 + S-03 + S-04) Stack locale up et healthy. Pret pour seed apres creation compte admin Baserow.
90 lines
3.2 KiB
Makefile
90 lines
3.2 KiB
Makefile
.PHONY: help up down restart logs ps clean reset shell-docmost shell-baserow backup backup-docmost backup-baserow status
|
|
|
|
DATE := $(shell date +%Y%m%d-%H%M%S)
|
|
BACKUP_DIR := ./backups
|
|
|
|
help:
|
|
@echo "formation-hub — commandes disponibles"
|
|
@echo ""
|
|
@echo "Stack lifecycle:"
|
|
@echo " make up Demarre la stack en background"
|
|
@echo " make down Stoppe la stack (conserve les volumes)"
|
|
@echo " make restart Redemarre tous les services"
|
|
@echo " make logs Suit les logs (Ctrl+C pour quitter)"
|
|
@echo " make ps Liste les services et leur etat"
|
|
@echo " make status Healthcheck rapide des endpoints HTTP"
|
|
@echo ""
|
|
@echo "Acces shell:"
|
|
@echo " make shell-docmost Shell dans le container Docmost"
|
|
@echo " make shell-baserow Shell dans le container Baserow"
|
|
@echo ""
|
|
@echo "Sauvegardes:"
|
|
@echo " make backup Backup complet (Docmost + Baserow)"
|
|
@echo " make backup-docmost Backup uniquement Docmost (pg_dump + files)"
|
|
@echo " make backup-baserow Backup uniquement Baserow (data dir)"
|
|
@echo ""
|
|
@echo "DESTRUCTIF:"
|
|
@echo " make clean Stoppe ET supprime les volumes (ATTENTION)"
|
|
@echo " make reset clean + up (reset complet)"
|
|
|
|
up:
|
|
@test -f .env || (echo "ERREUR: .env manquant. Copier .env.example vers .env et editer." && exit 1)
|
|
docker compose up -d
|
|
@echo ""
|
|
@echo "Stack demarree :"
|
|
@echo " Docmost : $${DOCMOST_URL:-http://localhost:3000}"
|
|
@echo " Baserow : $${BASEROW_URL:-http://localhost:8080}"
|
|
|
|
down:
|
|
docker compose down
|
|
|
|
restart:
|
|
docker compose restart
|
|
|
|
logs:
|
|
docker compose logs -f --tail=100
|
|
|
|
ps:
|
|
docker compose ps
|
|
|
|
status:
|
|
@echo "Docmost :" && curl -sf -o /dev/null -w " HTTP %{http_code} en %{time_total}s\n" http://localhost:3000 || echo " KO"
|
|
@echo "Baserow :" && curl -sf -o /dev/null -w " HTTP %{http_code} en %{time_total}s\n" http://localhost:8080 || echo " KO"
|
|
|
|
shell-docmost:
|
|
docker compose exec docmost sh
|
|
|
|
shell-baserow:
|
|
docker compose exec baserow bash
|
|
|
|
backup: backup-docmost backup-baserow
|
|
@echo "Backup complet termine dans $(BACKUP_DIR)/"
|
|
|
|
backup-docmost:
|
|
@mkdir -p $(BACKUP_DIR)
|
|
@echo "Backup Docmost (pg_dump + files)..."
|
|
docker compose exec -T docmost-db pg_dump -U docmost docmost | gzip > $(BACKUP_DIR)/docmost-db-$(DATE).sql.gz
|
|
docker compose exec -T docmost tar czf - /app/data/storage > $(BACKUP_DIR)/docmost-files-$(DATE).tar.gz
|
|
@echo " -> $(BACKUP_DIR)/docmost-db-$(DATE).sql.gz"
|
|
@echo " -> $(BACKUP_DIR)/docmost-files-$(DATE).tar.gz"
|
|
|
|
backup-baserow:
|
|
@mkdir -p $(BACKUP_DIR)
|
|
@echo "Backup Baserow (data dir)..."
|
|
docker compose exec -T baserow tar czf - /baserow/data > $(BACKUP_DIR)/baserow-$(DATE).tar.gz
|
|
@echo " -> $(BACKUP_DIR)/baserow-$(DATE).tar.gz"
|
|
|
|
seed-baserow:
|
|
@command -v python3 >/dev/null || (echo "ERREUR: python3 requis" && exit 1)
|
|
@test -n "$$BASEROW_EMAIL" -a -n "$$BASEROW_PASSWORD" || \
|
|
(echo "ERREUR: exporter BASEROW_EMAIL et BASEROW_PASSWORD" && exit 1)
|
|
@cd baserow/seed && pip install -q -r requirements.txt
|
|
BASEROW_URL=$${BASEROW_URL:-http://localhost:8080} \
|
|
python3 baserow/seed/seed.py
|
|
|
|
clean:
|
|
@echo "ATTENTION: cette commande supprime TOUS les volumes (donnees perdues)."
|
|
@read -p "Tapez 'oui' pour confirmer: " confirm; [ "$$confirm" = "oui" ] || exit 1
|
|
docker compose down -v
|
|
|
|
reset: clean up
|