4040 echo " Warning: Database initialization failed, but continuing..."
4141fi
4242
43+ echo " Verifying database tables were created..."
44+ table_count=$( docker exec -i ${MYSQL_NAME} mysql -u root -p" ${MYSQL_ROOT_PASSWORD:- github_smart_root_password} " " ${DB_NAME:- project_management} " -e " SHOW TABLES;" 2> /dev/null | grep -v " Tables_in" | wc -l)
45+ if [ " $table_count " -ge 7 ]; then
46+ echo " ✅ Database verification successful: Found $table_count tables"
47+ else
48+ echo " ⚠️ Warning: Only found $table_count tables (expected 7+)"
49+ fi
50+
4351echo " Starting/Restarting app container..."
4452docker rm -f ${APP_NAME} > /dev/null 2>&1 || true
4553docker run -d \
@@ -59,4 +67,38 @@ docker run -d \
5967
6068echo " App deployed and listening on port ${APP_PORT:- 8081} "
6169
70+ echo " Waiting for application to be ready..."
71+ for i in {1..30}; do
72+ if curl -s http://localhost:${APP_PORT:- 8081} > /dev/null 2>&1 ; then
73+ break
74+ fi
75+ sleep 2
76+ done
77+
78+ echo " Testing GitHub issues API..."
79+ if [ -n " ${GITHUB_TOKEN:- } " ]; then
80+ echo " GitHub token provided, testing API call..."
81+ api_response=$( curl -s -X POST http://localhost:${APP_PORT:- 8081} /api/getGHIssues.php 2> /dev/null || echo " API call failed" )
82+ if echo " $api_response " | grep -q " success\|issues\|data\|GitHub API token not configured" ; then
83+ echo " ✅ GitHub issues API test successful (API responded correctly)"
84+ else
85+ echo " ⚠️ GitHub issues API test failed or no response"
86+ fi
87+
88+ echo " Checking if issues were created in database..."
89+ issue_count=$( docker exec -i ${MYSQL_NAME} mysql -u root -p" ${MYSQL_ROOT_PASSWORD:- github_smart_root_password} " " ${DB_NAME:- project_management} " -e " SELECT COUNT(*) as count FROM gh_issues;" 2> /dev/null | grep -v " count" | tail -1)
90+ if [ " $issue_count " -gt 0 ] 2> /dev/null; then
91+ echo " ✅ Issues found in database: $issue_count issues"
92+ else
93+ echo " ⚠️ No issues found in database (this is normal if no GitHub token provided or no issues exist)"
94+ fi
95+ else
96+ echo " ℹ️ No GitHub token provided, skipping API test"
97+ echo " ℹ️ To test GitHub integration, set GITHUB_TOKEN environment variable"
98+ fi
99+
100+ echo " 🎉 Deployment completed successfully!"
101+ echo " 📊 Application: http://localhost:${APP_PORT:- 8081} "
102+ echo " 🗄️ Database: localhost:${MYSQL_PORT:- 3308} (MySQL)"
103+
62104
0 commit comments