Build&Deployment&CI/Jenkins
[Jenkins] 윈도우 배치 파일(Windows batch command) 샘플
1125521101
2017. 9. 6. 00:47
sc stop {project-name}
choice /t 1 /d n > NUL
choice /t 5 /d n > NUL
rmdir D:\Project\server\{project-name}\webapps\ROOT /S /Q
choice /t 3 /d n > NUL
mkdir D:\Project\server\{project-name}\webapps\ROOT
choice /t 3 /d n > NUL
cd /D D:\Project\server\{project-name}\webapps\ROOT
choice /t 1 /d n > NUL
mklink /D upload D:\Project\server\{project-name}\webapps\upload
copy C:\Windows\System32\config\systemprofile\.jenkins\workspace\{project-name}\target\dev.war D:\Project\server\{project-name}\webapps\ROOT\ROOT.war
choice /t 3 /d n > NUL
jar xf D:\Project\server\{project-name}\webapps\ROOT\ROOT.war
choice /t 3 /d n > NUL
del D:\Project\server\{project-name}\webapps\ROOT\ROOT.war
sc start {project-name}