From 4320251b3caad9efcd24acbb73c5df7244f64ce3 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 23 Dec 2025 20:11:36 +0100 Subject: [PATCH] Ajout guide de deploiement --- DEPLOYMENT.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 DEPLOYMENT.md diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..7ff8b14 --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,91 @@ +# Guide de deploiement + +## Premiere fois : Creer le depot sur Gitea + +1. Se connecter a Gitea : http://git.syoul.fr +2. Creer un nouveau depot : + - Nom : `infrastructure` + - Visibilite : Prive (recommandee) + - Ne pas initialiser avec README, .gitignore, etc. + +## Pousser le code sur Gitea + +```bash +cd /home/syoul/git.syoul.fr + +# Verifier le remote +git remote -v + +# Pousser sur Gitea +git push -u origin main +``` + +## Sur le serveur : Cloner le depot + +```bash +# Se connecter au serveur +ssh portainer2 + +# Cloner dans /opt +cd /opt +git clone git@git.syoul.fr:syoul/infrastructure.git + +# Ou si vous preferez un autre nom +git clone git@git.syoul.fr:syoul/infrastructure.git infrastructure + +# Creer les fichiers secrets +cd infrastructure +cp consul/env.template consul/.env +cp registrator/env.template registrator/.env +cp gitea/gitea.env.template gitea/gitea.env # Si vous creez un template + +# Editer ces fichiers avec les vraies valeurs +nano consul/.env +nano registrator/.env +nano gitea/gitea.env +``` + +## Mise a jour sur le serveur + +```bash +cd /opt/infrastructure +git pull + +# Redemarrer les services modifies si necessaire +cd consul && docker compose up -d +cd ../registrator && docker compose up -d +# etc. +``` + +## Structure sur le serveur + +``` +/opt/ + infrastructure/ # Clone du repo git + consul/ + docs/ + gitea/ + postgres/ + registrator/ + woodpecker/ +``` + +Ou avec des symlinks : + +```bash +# Creer des symlinks depuis /opt/[service] vers /opt/infrastructure/[service] +cd /opt +ln -s infrastructure/consul consul +ln -s infrastructure/gitea gitea +ln -s infrastructure/postgres postgres +ln -s infrastructure/registrator registrator +ln -s infrastructure/woodpecker woodpecker +``` + +## Workflow de travail + +1. **Modifier localement** : Faire les changements sur votre machine +2. **Commit** : `git add . && git commit -m "Description"` +3. **Push** : `git push origin main` +4. **Sur le serveur** : `cd /opt/infrastructure && git pull` +