배포용 젠킨스파일 생성
Some checks failed
LocalNet_front/pipeline/head There was a failure building this commit
Some checks failed
LocalNet_front/pipeline/head There was a failure building this commit
This commit is contained in:
parent
b699595239
commit
027c996626
40
jenkinsfile
Normal file
40
jenkinsfile
Normal file
@ -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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user