Commit 484e145a by yiling.shen

add comprehensive clinic JSON files check and data import diagnostics

parent 75df3d72
Pipeline #3207 failed in 0 seconds
...@@ -49,6 +49,24 @@ deploy_to_production: ...@@ -49,6 +49,24 @@ deploy_to_production:
- echo "Check clinic distribution" - echo "Check clinic distribution"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && docker compose exec -T mysql mysql -u root -pdev_password_123 -e 'USE callback_system; SELECT clinic_name, COUNT(*) as count FROM patients GROUP BY clinic_name ORDER BY count DESC;' || echo 'Cannot get clinic distribution'" - ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && docker compose exec -T mysql mysql -u root -pdev_password_123 -e 'USE callback_system; SELECT clinic_name, COUNT(*) as count FROM patients GROUP BY clinic_name ORDER BY count DESC;' || echo 'Cannot get clinic distribution'"
- echo "Basic database check end" - echo "Basic database check end"
- echo "Clinic JSON files check start"
- echo "Check clinic patient json directory"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && ls -la 诊所患者json/ 2>/dev/null || echo 'Clinic patient json directory not found'"
- echo "Check specific clinic files with file sizes"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && for file in 东亭门诊.json 大丰门诊.json 惠山门诊.json 新吴门诊.json 河埒门诊.json 红豆门诊.json 通善口腔医院.json 马山门诊.json 学前街门诊.json; do if [ -f \"诊所患者json/\$file\" ]; then size=\$(stat -c%s \"诊所患者json/\$file\"); echo \"✓ \$file exists (size: \$size bytes)\"; else echo \"✗ \$file missing\"; fi; done"
- echo "Check 学前街门诊.json specifically"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && if [ -f \"诊所患者json/学前街门诊.json\" ]; then echo \"学前街门诊.json exists\"; ls -la \"诊所患者json/学前街门诊.json\"; else echo \"学前街门诊.json missing - this is the problem!\"; fi"
- echo "Check if 学前街门诊.json exists in other locations"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && find . -name \"*学前街*\" -type f 2>/dev/null || echo 'No files found with 学前街 in name'"
- echo "Clinic JSON files check end"
- echo "Data import check start"
- echo "Check safe_import_patients.py script"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && ls -la safe_import_patients.py 2>/dev/null || echo 'safe_import_patients.py not found'"
- echo "Check Python environment in app container"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && docker compose exec -T patient_callback_app python --version 2>/dev/null || echo 'Cannot check Python version'"
- echo "Try to run safe_import_patients.py manually"
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd customer-recall && docker compose exec -T patient_callback_app python safe_import_patients.py 2>&1 || echo 'safe_import_patients.py execution failed'"
- echo "Data import check end"
- echo "Deployment completed successfully" - echo "Deployment completed successfully"
only: only:
- master - master
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment