Updating Scripts and CI Workflow
CI - Fruit API / build-and-test (push) Successful in 41s

This commit is contained in:
ahmedgamalyousef
2025-10-04 22:36:26 +03:00
parent 63fb40bb5e
commit f95728213f
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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
+2 -2
View File
@@ -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",
+4
View File
@@ -796,3 +796,7 @@ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201
✅ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201