From 9df384532763e32a0b2c42640a24701b7e48399b Mon Sep 17 00:00:00 2001 From: SEAN Date: Wed, 3 Dec 2025 12:12:45 +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 | 59 ++++++++++++++++++++++++++++++++++++++++++++++ Jenkinsfile | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 127 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..1d13ec6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,59 @@ +# 특정 환경에 따라 추가 +./private/ +./privacy/ +./publish/ +publish/ +./bin/ + + + +# 기본 파일 및 폴더 제외 +*.log +*.env +*.bak +*.tmp +*.swp + +# macOS 관련 파일 제외 +._* +.DS_Store +.AppleDouble +.LSOverride +.Spotlight-V100 +.Trashes + +# Windows 관련 +Thumbs.db +ehthumbs.db +desktop.ini + +# Visual Studio 관련 +.vscode/ +.vs/ +*.suo +*.user +*.userosscache +*.sln.docstates + +# Rider 관련 +.idea/ +*.sln.iml + +# .NET 관련 +bin/ +obj/ +*.pdb +*.dll +*.exe +*.nuget/ + +# Blazor 관련 +**/wwwroot/_framework/ + +# Docker 관련 +docker-compose.override.yml +Dockerfile + +# 기타 캐시 파일 +**/*.cache +**/*.tmp \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..75529e1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,67 @@ +pipeline { + agent any + + environment { + TARGET_BUILD_CONTAINER = '' + TARGET_RUN_CONTAINER = '' + CONTAINER_SRC_PATH = '/src' + } + + stages { + stage('Check Branch & Setup ENV') { + steps { + script { + def branchName = env.BRANCH_NAME + echo "Current Git Branch : ${branchName}" + if (branchName == 'develop') { + env.TARGET_BUILD_CONTAINER = 'spms-back-build-debug' + env.TARGET_RUN_CONTAINER = 'spms-run-debug' + echo "[DEV Mode] SET DEBUG Container" + } + else if (branchName == 'main') { + env.TARGET_BUILD_CONTAINER = 'spms-back-build-release' + env.TARGET_RUN_CONTAINER = 'spms-run-release' + echo ">>> [PROD Mode] SET Release Container + } else { + error "This branch(${branchName}) can't set container (USE develop or main branch)" + } + } + } + } + + stage('Checkout Source') { + steps { + cleanWs() + checkout scm + echo "Git Checkout Complete" + } + } + + stage('Copy to Container') { + steps { + script { + def containerId = sh(script: "docker ps -aqf 'name=${env.TARGET_BUILD_CONTAINER}'", returnStdout: true).trim() + + if (containerId) { + sh "docker cp ${WORKSPACE}/. ${env.TARGET_BUILD_CONTAINER}:${env.CONTAINER_SRC_PATH}" + echo "Source code copied to ${env.TARGET_BUILD_CONTAINER}" + } else { + error "Build container ${env.TARGET_BUILD_CONTAINER} not found!" + } + } + } + } + + stage('Build & Deploy') { + steps { + script { + echo "Building..." + sh "docker start -a ${env.TARGET_BUILD_CONTAINER}" + + echo "Restarting..." + sh "docker restart ${env.TARGET_RUN_CONTAINER}" + } + } + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..10f1fd6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# SPMS \ No newline at end of file