diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 0000000..c0f5a7e --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,40 @@ +pipeline { + agent any + tools { + nodejs 'nodejs22' + } + stages { + stage('Build'){ + steps { + bat 'npm install' + bat 'npm ci' + bat 'npm run build' + } + } + stage('Deploy') { + steps { + // 로컬 Nginx 서버에 빌드 파일 배포 + bat ''' + :: 루트경로 설정 + set NGINX_ROOT=C:\\nginx\\html + + :: 기존 빌드 삭제 + if exist "%NGINX_ROOT%\\dist" rmdir /s /q "%NGINX_ROOT%\\dist" + + :: 빌드 파일 복사 + xcopy /s /y dist\\* "%NGINX_ROOT%\\dist\\" + ''' + } + } + stage('Restart Server') { + steps { + // 로컬 Nginx 서버 재실행 + bat ''' + net stop nginx + timeout /t 2 /nobreak > nul + net start nginx + ''' + } + } + } +}