commit aa99a5e6e758c3ac7a21b60a98d10eb52b834132 Author: SEAN Date: Wed Dec 3 14:24:07 2025 +0900 [๐Ÿ“] GIT init 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