Files
backend/resources/docs/pre-push.md
A'zamov Samandar 256e80cc23 first commit
2025-11-21 14:41:16 +05:00

35 lines
685 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# jst pre-push ornatish
`pre-push vazifasi`: gitga push qilishdan avval testlarni avtomatik bajarib barcha testlardan muvofaqiyatli otsa push qiladi
# Ornatish
`.git/hooks/pre-push` faylini yarating va manabu kodlarni fayilga yozing
```bash
#!/bin/bash
echo "🚀 Testlar ishga tushmoqda (Docker konteyner ichida)..."
docker compose run --rm -T web pytest -v
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "❌ Testlar muvaffaqiyatsiz tugadi. Push bekor qilindi."
exit 1
fi
echo "✅ Barcha testlar muvaffaqiyatli otdi. Pushga ruxsat berildi."
exit 0
```
fayilga kerakli permissionlarni bering
```bash
sudo chmod +x .git/hooks/pre-push
```
va hammasi tayyor