From aa99a5e6e758c3ac7a21b60a98d10eb52b834132 Mon Sep 17 00:00:00 2001 From: SEAN Date: Wed, 3 Dec 2025 14:24:07 +0900 Subject: [PATCH] =?UTF-8?q?[=F0=9F=93=9D]=20GIT=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 45 +++++++++++++++++++++++++++++++ Jenkinsfile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 Jenkinsfile create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4c1231 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Dependencies (가장 중요: 라이브러리 폴더 제외) +node_modules/ +.pnp +.pnp.js + +# Production Build (Vite 빌드 결과물 제외) +dist/ +dist-ssr/ + +# Environment Variables (환경변수 - 보안상 필수 제외) +.env +.env.local +.env.*.local + +# Logs (npm/yarn 로그 파일) +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +# WebStorm (JetBrains) 관련 +.idea/ +*.iws +*.iml +*.ipr + +# VS Code 관련 +.vscode/ +*.code-workspace + +# OS System Files (macOS) +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Testing +coverage/ + +# TypeScript +*.tsbuildinfo \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..fa15483 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,77 @@ +def TARGET_FRONT_BUILD = '' +def TARGET_RUN_SERVER = '' +def CONTAINER_SRC_PATH = '/src' + +pipeline { + agent any + + stages { + stage('Check Branch & Setup') { + steps { + script { + def branchName = env.BRANCH_NAME + echo "Current Branch: ${branchName}" + + if (branchName == 'develop') { + // develop 브랜치 -> Debug 컨테이너 + TARGET_FRONT_BUILD = 'spms-front-build-debug' + TARGET_RUN_SERVER = 'spms-run-debug' + echo "[DEV Mode] Target: DEBUG Container" + } + else if (branchName == 'main') { + TARGET_FRONT_BUILD = 'spms-front-build-release' + TARGET_RUN_SERVER = 'spms-run-release' + echo ">>> [PROD Mode] Target: RELEASE Container" + } + else { + error "This branch(${branchName}) can't set container (USE develop or main branch)" + } + } + } + } + + stage('Checkout') { + steps { + cleanWs() + checkout scm + echo "Git Checkout Complete" + } + } + + // [3단계] 컨테이너로 소스 복사 + stage('Copy to Container') { + steps { + script { + def sourcePath = "${WORKSPACE}/react/." + echo "Copying from ${sourcePath} to ${TARGET_FRONT_BUILD}" + def containerId = sh(script: "docker ps -aqf 'name=${TARGET_FRONT_BUILD}'", returnStdout: true).trim() + + if (containerId) { + sh "docker cp ${sourcePath} ${TARGET_FRONT_BUILD}:${CONTAINER_SRC_PATH}" + } else { + error "Container ${TARGET_FRONT_BUILD} not found!" + } + } + } + } + + stage('Build Frontend') { + steps { + script { + echo "Starting React Build..." + sh "docker start -a ${TARGET_FRONT_BUILD}" + echo "React Build Complete." + } + } + } + + stage('Apply & Restart') { + steps { + script { + echo "Restarting Backend Server (${TARGET_RUN_SERVER})..." + sh "docker restart ${TARGET_RUN_SERVER}" + } + } + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b11be39 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# SPMS_BO