Files
distribution_erp/verify-build.sh
T
chpark 3e135041ac Initial commit: ILSHIN PLM 프로젝트 소스 코드
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 17:49:38 +09:00

138 lines
4.2 KiB
Bash
Executable File

#!/bin/bash
echo "=========================================="
echo "Build Verification Script"
echo "=========================================="
# Java 클래스 파일 확인
echo ""
echo "1. Checking Java class files..."
CLASS_COUNT=$(find WebContent/WEB-INF/classes -name "*.class" 2>/dev/null | wc -l | tr -d ' ')
if [ "$CLASS_COUNT" -gt 0 ]; then
echo "✓ Found $CLASS_COUNT compiled Java classes"
# 주요 컨트롤러 클래스 확인
echo ""
echo "Checking key controller classes:"
if [ -f "WebContent/WEB-INF/classes/com/pms/controller/ApprovalController.class" ]; then
echo " ✓ ApprovalController.class exists"
else
echo " ✗ ApprovalController.class missing"
fi
if [ -f "WebContent/WEB-INF/classes/com/pms/controller/LoginController.class" ]; then
echo " ✓ LoginController.class exists"
else
echo " ✗ LoginController.class missing"
fi
if [ -f "WebContent/WEB-INF/classes/com/pms/controller/MainController.class" ]; then
echo " ✓ MainController.class exists"
else
echo " ✗ MainController.class missing"
fi
if [ -f "WebContent/WEB-INF/classes/com/pms/controller/CommonController.class" ]; then
echo " ✓ CommonController.class exists"
else
echo " ✗ CommonController.class missing"
fi
else
echo "✗ No Java classes found! Build may have failed."
exit 1
fi
# XML 리소스 파일 확인
echo ""
echo "2. Checking XML resource files..."
XML_COUNT=$(find WebContent/WEB-INF/classes -name "*.xml" 2>/dev/null | wc -l | tr -d ' ')
if [ "$XML_COUNT" -gt 0 ]; then
echo "✓ Found $XML_COUNT XML resource files"
if [ -f "WebContent/WEB-INF/classes/com/pms/mapper/approval.xml" ]; then
echo " ✓ MyBatis mapper files present"
fi
else
echo "⚠ No XML files found (may be normal depending on project)"
fi
# Properties 파일 확인
echo ""
echo "3. Checking properties files..."
PROP_COUNT=$(find WebContent/WEB-INF/classes -name "*.properties" 2>/dev/null | wc -l | tr -d ' ')
if [ "$PROP_COUNT" -gt 0 ]; then
echo "✓ Found $PROP_COUNT properties files"
else
echo "⚠ No properties files found (may be normal)"
fi
# 라이브러리 확인
echo ""
echo "4. Checking required libraries..."
if [ -d "WebContent/WEB-INF/lib" ]; then
JAR_COUNT=$(find WebContent/WEB-INF/lib -name "*.jar" 2>/dev/null | wc -l | tr -d ' ')
echo "✓ Found $JAR_COUNT JAR files in lib directory"
# Spring 라이브러리 확인
if ls WebContent/WEB-INF/lib/*spring*.jar 1> /dev/null 2>&1; then
echo " ✓ spring library present"
else
echo " ⚠ spring library might be missing"
fi
# MyBatis 라이브러리 확인
if ls WebContent/WEB-INF/lib/*mybatis*.jar 1> /dev/null 2>&1; then
echo " ✓ mybatis library present"
else
echo " ⚠ mybatis library might be missing"
fi
# PostgreSQL 드라이버 확인
if ls WebContent/WEB-INF/lib/*postgresql*.jar 1> /dev/null 2>&1; then
echo " ✓ postgresql library present"
else
echo " ⚠ postgresql library might be missing"
fi
# Servlet API 확인
if ls WebContent/WEB-INF/lib/*servlet*.jar 1> /dev/null 2>&1; then
echo " ✓ servlet library present"
else
echo " ⚠ servlet library might be missing"
fi
else
echo "✗ lib directory not found!"
exit 1
fi
# Spring 설정 파일 확인
echo ""
echo "5. Checking Spring configuration..."
if [ -f "WebContent/WEB-INF/dispatcher-servlet.xml" ]; then
echo "✓ dispatcher-servlet.xml exists"
else
echo "✗ dispatcher-servlet.xml missing!"
fi
if [ -f "WebContent/WEB-INF/web.xml" ]; then
echo "✓ web.xml exists"
else
echo "✗ web.xml missing!"
fi
# 최종 결과
echo ""
echo "=========================================="
if [ "$CLASS_COUNT" -gt 0 ]; then
echo "BUILD VERIFICATION: SUCCESS"
echo "Application is ready for deployment!"
else
echo "BUILD VERIFICATION: FAILED"
echo "Please run the build script before deployment!"
exit 1
fi
echo "=========================================="