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
I4 — Forms publics + space etudiant : - baserow/seed/seed_forms.py : cree forms publics sur attribution + intervention (saisie heures via lien sans compte). Form cree OK, field-options endpoint retourne 404 sur Baserow 1.30 — a investiguer (URL different selon version). - docmost/setup/create-space-etudiant.py : cree space prive + invite etudiant + page Welcome template. Slug strict lettres+chiffres only (fix Docmost). I5 — Ops : - scripts/healthcheck.sh : check UI + API health (Docmost+Baserow), affiche status containers Docker. 4/4 OK en local. - scripts/cron-install.sh : installe cron quotidien backup + healthcheck */5min. Makefile : targets seed-baserow-forms, create-space-etudiant. Tous les targets utilisent maintenant .venv/ local pour eviter pip systeme. .gitignore : exclut .venv/ + __pycache__/.
121 lines
4.6 KiB
Makefile
121 lines
4.6 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:
|
|
@test -d .venv || python3 -m venv .venv
|
|
@.venv/bin/pip install -q -r baserow/seed/requirements.txt
|
|
@test -n "$$BASEROW_EMAIL" -a -n "$$BASEROW_PASSWORD" || \
|
|
(echo "ERREUR: exporter BASEROW_EMAIL et BASEROW_PASSWORD" && exit 1)
|
|
BASEROW_URL=$${BASEROW_URL:-http://localhost:8080} \
|
|
.venv/bin/python baserow/seed/seed.py
|
|
|
|
setup-docmost-guide:
|
|
@echo "Docmost API publique = feature Enterprise payante."
|
|
@echo "Pour Community AGPL, soit :"
|
|
@echo " - Setup manuel UI (10 min) — cf docmost/setup/README.md"
|
|
@echo " - Seed automatise via endpoints internes — cf seed-docmost"
|
|
|
|
seed-docmost:
|
|
@test -d .venv || python3 -m venv .venv
|
|
@.venv/bin/pip install -q -r docmost/setup/requirements.txt
|
|
@test -n "$$DOCMOST_ADMIN_EMAIL" -a -n "$$DOCMOST_ADMIN_PASSWORD" || \
|
|
(echo "ERREUR: exporter DOCMOST_ADMIN_EMAIL et DOCMOST_ADMIN_PASSWORD" && exit 1)
|
|
DOCMOST_URL=$${DOCMOST_URL:-http://localhost:3000} \
|
|
.venv/bin/python docmost/setup/seed.py
|
|
|
|
seed-baserow-forms:
|
|
@test -d .venv || python3 -m venv .venv
|
|
@.venv/bin/pip install -q -r baserow/seed/requirements.txt
|
|
@test -n "$$BASEROW_EMAIL" -a -n "$$BASEROW_PASSWORD" || \
|
|
(echo "ERREUR: exporter BASEROW_EMAIL et BASEROW_PASSWORD" && exit 1)
|
|
BASEROW_URL=$${BASEROW_URL:-http://localhost:8080} \
|
|
.venv/bin/python baserow/seed/seed_forms.py
|
|
|
|
create-space-etudiant:
|
|
@test -d .venv || python3 -m venv .venv
|
|
@.venv/bin/pip install -q -r docmost/setup/requirements.txt
|
|
@test -n "$$NOM" -a -n "$$PRENOM" -a -n "$$EMAIL" || \
|
|
(echo "ERREUR: exporter NOM, PRENOM, EMAIL (etudiant)" && exit 1)
|
|
DOCMOST_URL=$${DOCMOST_URL:-http://localhost:3000} \
|
|
.venv/bin/python docmost/setup/create-space-etudiant.py \
|
|
--nom "$$NOM" --prenom "$$PRENOM" --email "$$EMAIL"
|
|
|
|
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
|