diff --git a/Jenkinsfile b/Jenkinsfile index 9b08c9a..a675c11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,108 +1,59 @@ pipeline { agent any - environment { - DEPLOY_DIR = '/var/www/zioinfo' - APP_DIR = '/opt/zioinfo/app' - JAVA_HOME = '/usr/lib/jvm/java-21-openjdk-amd64' - MVN = '/usr/bin/mvn' - NODE_HOME = '/usr/bin' + SRC = '/opt/zioinfo/src' + JAR_DIR = '/opt/zioinfo/app' + STATIC = '/var/www/zioinfo' + MVN = '/usr/bin/mvn' + NOTIFY = "${ITSM_BASE_URL}/api/messenger/webhook" } - options { buildDiscarder(logRotator(numToKeepStr: '5')) timeout(time: 20, unit: 'MINUTES') + timestamps() } - stages { stage('Checkout') { steps { - echo "브랜치: ${env.GIT_BRANCH ?: 'main'} | 커밋: ${env.GIT_COMMIT?.take(7) ?: '-'}" checkout([ - $class: 'GitSCM', - branches: scm.branches, + $class: 'GitSCM', branches: scm.branches, userRemoteConfigs: scm.userRemoteConfigs, - extensions: [ - // manual/ 폴더 체크아웃 제외 (배포 대상 아님) - [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [ - [path: 'frontend'], - [path: 'backend'], - ]] - ] + extensions: [[$class: 'SparseCheckoutPaths', + sparseCheckoutPaths: [[path: 'frontend'], [path: 'backend']] + ]] ]) } } - stage('Frontend Build') { steps { dir('frontend') { - sh ''' - echo "=== [1/3] React 빌드 ===" - npm ci --legacy-peer-deps --prefer-offline 2>/dev/null || npm install --legacy-peer-deps - npm run build - echo "빌드 결과: $(ls ../backend/src/main/resources/static/assets/ | wc -l) 파일" - ''' + sh 'npm ci --legacy-peer-deps --prefer-offline 2>/dev/null || npm install --legacy-peer-deps' + sh 'npm run build' } } } - stage('Backend Build') { steps { dir('backend') { - sh ''' - echo "=== [2/3] Spring Boot 빌드 ===" - ${MVN} clean package -DskipTests -q - JAR=$(find target -name "*.jar" ! -name "*sources*" | head -1) - echo "JAR: $JAR ($(du -sh $JAR | cut -f1))" - ''' + sh "${MVN} clean package -DskipTests -q" } } } - stage('Deploy') { + when { branch 'main' } steps { - sh ''' - echo "=== [3/3] 배포 ===" - JAR=$(find backend/target -name "*.jar" ! -name "*sources*" | head -1) - - # 앱 디렉터리 확인 - mkdir -p ${APP_DIR} ${DEPLOY_DIR} - - # JAR 배포 - cp "$JAR" ${APP_DIR}/app.jar - - # React 정적 파일 배포 - cp -r backend/src/main/resources/static/. ${DEPLOY_DIR}/ - - # Spring Boot 서비스 재시작 - systemctl restart zioinfo || true + sh """ + cp backend/target/*.jar ${JAR_DIR}/app.jar + cp -r backend/src/main/resources/static/. ${STATIC}/ + systemctl restart zioinfo sleep 4 - - # 헬스체크 - for i in 1 2 3 4 5; do - HTTP=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/api/company 2>/dev/null) - if [ "$HTTP" = "200" ]; then - echo "배포 성공 (Spring Boot HTTP $HTTP)" - exit 0 - fi - echo "헬스체크 ${i}/5 대기중 (HTTP: $HTTP)..." - sleep 3 - done - echo "경고: Spring Boot 응답 없음 — 서비스 상태 확인 필요" - ''' + systemctl is-active zioinfo || exit 1 + """ } } } - post { - success { - echo "✅ 배포 완료: ${currentBuild.displayName} (${currentBuild.durationString})" - } - failure { - echo "❌ 배포 실패: ${currentBuild.displayName} — 로그 확인 필요" - } - always { - cleanWs(cleanWhenNotBuilt: false, cleanWhenSuccess: false) - } + success { sh "curl -sf -X POST ${NOTIFY} -H 'Content-Type:application/json' -d '{\"event\":\"build_result\",\"room\":\"ops\",\"success\":true,\"result_summary\":\"✅ zioinfo-web 배포 완료 #${BUILD_NUMBER}\"}' 2>/dev/null || true" } + failure { sh "curl -sf -X POST ${NOTIFY} -H 'Content-Type:application/json' -d '{\"event\":\"build_result\",\"room\":\"ops\",\"success\":false,\"result_summary\":\"❌ zioinfo-web 빌드 실패 #${BUILD_NUMBER}\"}' 2>/dev/null || true" } } -} +} \ No newline at end of file diff --git a/frontend/public/screenshots/01_itsm_login.png b/frontend/public/screenshots/01_itsm_login.png new file mode 100644 index 0000000..14f0742 Binary files /dev/null and b/frontend/public/screenshots/01_itsm_login.png differ diff --git a/frontend/public/screenshots/02_itsm_dashboard.png b/frontend/public/screenshots/02_itsm_dashboard.png new file mode 100644 index 0000000..788bc2a Binary files /dev/null and b/frontend/public/screenshots/02_itsm_dashboard.png differ diff --git a/frontend/public/screenshots/home_02_greeting.png b/frontend/public/screenshots/home_02_greeting.png new file mode 100644 index 0000000..9e5d074 Binary files /dev/null and b/frontend/public/screenshots/home_02_greeting.png differ diff --git a/frontend/public/screenshots/home_03_ci.png b/frontend/public/screenshots/home_03_ci.png new file mode 100644 index 0000000..9aa7d5b Binary files /dev/null and b/frontend/public/screenshots/home_03_ci.png differ diff --git a/frontend/public/screenshots/home_04_history.png b/frontend/public/screenshots/home_04_history.png new file mode 100644 index 0000000..647a7d9 Binary files /dev/null and b/frontend/public/screenshots/home_04_history.png differ diff --git a/frontend/public/screenshots/home_05_org.png b/frontend/public/screenshots/home_05_org.png new file mode 100644 index 0000000..e774118 Binary files /dev/null and b/frontend/public/screenshots/home_05_org.png differ diff --git a/frontend/public/screenshots/home_06_location.png b/frontend/public/screenshots/home_06_location.png new file mode 100644 index 0000000..f206268 Binary files /dev/null and b/frontend/public/screenshots/home_06_location.png differ diff --git a/frontend/public/screenshots/home_08_business.png b/frontend/public/screenshots/home_08_business.png new file mode 100644 index 0000000..f6b290f Binary files /dev/null and b/frontend/public/screenshots/home_08_business.png differ diff --git a/frontend/public/screenshots/home_09_news.png b/frontend/public/screenshots/home_09_news.png new file mode 100644 index 0000000..ca66daa Binary files /dev/null and b/frontend/public/screenshots/home_09_news.png differ diff --git a/frontend/public/screenshots/home_10_recruit.png b/frontend/public/screenshots/home_10_recruit.png new file mode 100644 index 0000000..07c2829 Binary files /dev/null and b/frontend/public/screenshots/home_10_recruit.png differ diff --git a/frontend/public/screenshots/home_11_contact.png b/frontend/public/screenshots/home_11_contact.png new file mode 100644 index 0000000..675bdd9 Binary files /dev/null and b/frontend/public/screenshots/home_11_contact.png differ diff --git a/frontend/public/screenshots/manager_06_audit.png b/frontend/public/screenshots/manager_06_audit.png new file mode 100644 index 0000000..0ad676f Binary files /dev/null and b/frontend/public/screenshots/manager_06_audit.png differ diff --git a/frontend/public/screenshots/manager_login_debug.png b/frontend/public/screenshots/manager_login_debug.png new file mode 100644 index 0000000..50e89f0 Binary files /dev/null and b/frontend/public/screenshots/manager_login_debug.png differ diff --git a/frontend/public/screenshots/manager_login_fail.png b/frontend/public/screenshots/manager_login_fail.png new file mode 100644 index 0000000..0ad676f Binary files /dev/null and b/frontend/public/screenshots/manager_login_fail.png differ