[📝] GIT init
This commit is contained in:
commit
aa99a5e6e7
45
.gitignore
vendored
Normal file
45
.gitignore
vendored
Normal file
|
|
@ -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
|
||||
77
Jenkinsfile
vendored
Normal file
77
Jenkinsfile
vendored
Normal file
|
|
@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user