localhost-front/jenkinsfile
nevermoregb b4c9169807
All checks were successful
LocalNet_front/pipeline/head This commit looks good
수정
2025-03-01 13:44:33 +09:00

41 lines
1.2 KiB
Plaintext

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 '''
taskkill /f /im nginx.exe > nul 2>&1
ping -n 3 127.0.0.1 > nul
start "" "C:\\nginx\\nginx.exe"
'''
}
}
}
}