From f38ce9e9ccd52fe90c9bc6b26b28a9099b8eddd7 Mon Sep 17 00:00:00 2001 From: "fefe.clochette" Date: Mon, 8 Dec 2025 12:40:45 +0100 Subject: [PATCH] param --- .devtools/README.md | 14 ++++++ .devtools/git-aliases.sh | 69 ++++++++++++++++++++++++++ .devtools/install.sh | 12 +++++ .gitea/ISSUE_TEMPLATE/config.yml | 1 + .gitea/ISSUE_TEMPLATE/issue_request.md | 69 ++++++++++++++++++++++++++ .gitea/workflows/deploy.yml | 37 ++++++++++++++ .vscode/extensions.json | 3 ++ .vscode/settings.json | 7 +++ README.md | 2 +- 9 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 .devtools/README.md create mode 100644 .devtools/git-aliases.sh create mode 100644 .devtools/install.sh create mode 100644 .gitea/ISSUE_TEMPLATE/config.yml create mode 100644 .gitea/ISSUE_TEMPLATE/issue_request.md create mode 100644 .gitea/workflows/deploy.yml create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.devtools/README.md b/.devtools/README.md new file mode 100644 index 0000000..2a679ac --- /dev/null +++ b/.devtools/README.md @@ -0,0 +1,14 @@ +cat > README.md << 'EOF' +# 🛠️ Outils de développement + +## Installation + +Exécutez une seule fois après avoir cloné le repo : + +./.devtools/install.sh + +## Ré-installation si besoin + +git config --global --unset alias.deploy +./.devtools/install.sh + diff --git a/.devtools/git-aliases.sh b/.devtools/git-aliases.sh new file mode 100644 index 0000000..5652a39 --- /dev/null +++ b/.devtools/git-aliases.sh @@ -0,0 +1,69 @@ +#!/bin/bash +echo "🔧 Installation des commandes Git personnalisées..." + +# Commande deploy +git config --global alias.deploy '!f() { + current_branch=$(git branch --show-current); + echo "📍 Branche actuelle: $current_branch"; + echo "🔍 État avant auto-commit:"; + git status --short; + + # Auto-commit des modifications si nécessaire + if ! git diff-index --quiet HEAD --; then + echo "💾 Auto-commit des modifications sur $current_branch..."; + git add .; + git commit -m "Auto-commit for deploy to $1 - $(date +%Y-%m-%d\ %H:%M:%S)"; + echo "✅ Modifications commitées sur $current_branch !"; + else + echo "ℹ️ Pas de modifications à commiter sur $current_branch"; + fi; + + echo "🔍 État après auto-commit:"; + git status --short; + echo "🔍 Dernier commit sur $current_branch:"; + git log --oneline -1; + + if [ "$1" = "staging" ]; then + echo "🚀 Push de $current_branch vers deploiement-staging..."; + git push origin $current_branch:deploiement-staging --force; + echo "✅ Staging mis à jour avec le contenu de $current_branch !"; + elif [ "$1" = "production" ] || [ "$1" = "prod" ]; then + echo "🚀 Déploiement en production..."; + git checkout main; + git pull origin main; + git merge $current_branch -m "Deploy from $current_branch to production"; + git push origin main; + git checkout $current_branch; + else + echo "❌ Usage: git deploy [staging|production]"; + return 1; + fi; + + echo "🔍 Vous êtes toujours sur: $(git branch --show-current)"; + echo "✅ Déployé sur $1 !"; +}; f' + +# Commande publish +git config --global alias.publish '!f() { + current_branch=$(git branch --show-current); + git push origin $current_branch; + echo "✅ Branche $current_branch publiée !"; + echo "👉 Créez votre PR dans Gitea : $current_branch → main"; +}; f' + +# Commande cleanup +git config --global alias.cleanup '!f() { + current_branch=$(git branch --show-current); + git checkout main; + git pull origin main; + git branch -d $current_branch 2>/dev/null; + git push origin --delete $current_branch 2>/dev/null; + echo "🧹 Nettoyage terminé !"; +}; f' + +echo "✅ Commandes Git installées !" +echo "📖 Utilisation :" +echo " git deploy staging # → Teste sur staging" +echo " git deploy production # → Déploie en prod" +echo " git publish # → Publie pour PR" +echo " git cleanup # → Nettoie après merge" diff --git a/.devtools/install.sh b/.devtools/install.sh new file mode 100644 index 0000000..4c676a2 --- /dev/null +++ b/.devtools/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "🔧 Installation de l'environnement de développement..." + +# Installer les aliases Git +source .devtools/git-aliases.sh + +# Ajouter .devtools au gitignore local (pas versionné) +echo "/.devtools/" >> .git/info/exclude + +echo "✅ Installation terminée !" +echo "ℹ️ Les outils de dev sont maintenant ignorés localement" +echo "🚀 Vous pouvez maintenant utiliser: git deploy staging" diff --git a/.gitea/ISSUE_TEMPLATE/config.yml b/.gitea/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/issue_request.md b/.gitea/ISSUE_TEMPLATE/issue_request.md new file mode 100644 index 0000000..d60c895 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/issue_request.md @@ -0,0 +1,69 @@ +--- +name: Feature Request +about: Proposer une nouvelle fonctionnalité ou amélioration +title: '[FEATURE] ' +labels: 'enhancement, needs-review' +assignees: '' +--- + +## 🎯 Objectif + +**Quel est le problème que cette fonctionnalité résout ?** + + +**Quelle valeur ajoutée apporte-t-elle aux utilisateurs ?** + + +## 📝 Description détaillée + +**Fonctionnalité souhaitée :** + + +**Contexte d'utilisation :** + + + +## 🎨 Éléments visuels + + + +## ✅ Critères d'acceptation + + +### Fonctionnalités principales +- [ ] Critère 1 : +- [ ] Critère 2 : +- [ ] Critère 3 : + +### Interface utilisateur +- [ ] L'interface est intuitive et cohérente avec le design existant +- [ ] La fonctionnalité est accessible (WCAG) +- [ ] L'interface s'adapte aux différentes tailles d'écran (responsive) + +### Performance et technique +- [ ] Les temps de réponse sont inférieurs à X secondes +- [ ] La fonctionnalité est compatible avec les navigateurs supportés +- [ ] Les données sont validées côté client et serveur + +### Tests et documentation +- [ ] Tests unitaires écrits et passants +- [ ] Tests d'intégration réalisés +- [ ] Documentation utilisateur mise à jour +- [ ] Documentation technique rédigée + +## 🔧 Considérations techniques +**Impact estimé :** +- [ ] Faible (quelques heures) +- [ ] Moyen (quelques jours) +- [ ] Important (quelques semaines) + +## 📋 Informations complémentaires +**Priorité souhaitée :** +- [ ] Critique (bloquant) +- [ ] Haute (important) +- [ ] Moyenne (souhaitable) +- [ ] Basse (nice-to-have) + +**Contacts :** + +- Demandeur : \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..248d04d --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: Deploy to Staging and Production +on: + push: + branches: [main, deploiement-staging] + +jobs: + deploy-staging: + if: github.ref == 'refs/heads/deploiement-staging' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy to Staging + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.FTP_SERVER_PERCOLOUCO }} + username: ${{ secrets.FTP_USERNAME_PERCOLOUCO }} + password: ${{ secrets.FTP_PASSWORD_PERCOLOUCO }} + local-dir: ./ + server-dir: /www/staging/ # ← Nouveau chemin + + deploy-production: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy to Production + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.FTP_SERVER_PERCOLOUCO }} + username: ${{ secrets.FTP_USERNAME_PERCOLOUCO }} + password: ${{ secrets.FTP_PASSWORD_PERCOLOUCO }} + local-dir: ./ + server-dir: /www/mh/ # ← Production reste ici \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c83e263 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..242f622 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit" + } +} diff --git a/README.md b/README.md index 485d43d..b038f62 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -pachafamily \ No newline at end of file +pachafamily