Updating Scripts and CI Workflow
نجحت جميع الفحوصات
CI - Fruit API / build-and-test (push) Successful in 41s

هذا الالتزام موجود في:
ahmedgamalyousef
2025-10-04 22:36:26 +03:00
الأصل 63fb40bb5e
التزام f95728213f
4 ملفات معدلة مع 8 إضافات و3 حذوفات

عرض الملف

@@ -24,7 +24,7 @@ jobs:
- name: Run API in background
run: |
nohup python fruit_api.py &
python fruit_api.py &
sleep 5
- name: Run API tests

عرض الملف

@@ -337,3 +337,4 @@
2025-09-30 23:59:59 - METHOD:GET - ENDPOINT:/fruits - STATUS:400 - ERROR: db not connected
2025-10-01 00:15:00 - METHOD:GET - ENDPOINT:/fruits - STATUS:500 - ERROR: db not connected
2025-10-01 00:15:00 - METHOD:GET - ENDPOINT:/fruits - STATUS:500 - ERROR: db not connected
2025-10-01 00:15:00 - METHOD:GET - ENDPOINT:/fruits - STATUS:500 - ERROR: db not connected

عرض الملف

@@ -1,6 +1,6 @@
#!/usr/bin/bash
LOG_FILE="fruit_api.log"
# ALERT_URL="https://gahymah.systems.com"
ALERT_URL=" " # Here Any Endpoint
tail -Fn0 "$LOG_FILE" | while read line; do
if echo "$line" | grep -qiE "STATUS:(4[0-9]{2}|5[0-9]{2})|failed|timeout|error|exception"; then
@@ -15,7 +15,7 @@ tail -Fn0 "$LOG_FILE" | while read line; do
{
"error": "$line",
"timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"message": "Error detected in Fruit API logs",
"message": "Error detected in Ahmed Gamal's Fruit API logs",
"server_metrics": {
"ip": "$IP",
"cpu_usage": "$CPU",

عرض الملف

@@ -796,3 +796,7 @@ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201
✅ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201