localhost-back/Jenkinsfile
nevermoregb 3d8144eb0f
All checks were successful
LOCALNET-DEV/pipeline/head This commit looks good
4
2025-02-21 14:17:58 +09:00

38 lines
1.1 KiB
Groovy

pipeline {
agent any
tools {
gradle 'gradle8'
}
stages {
stage('Clean & Build') {
steps {
bat './gradlew clean build -x test'
}
}
stage('Deploy') {
steps {
bat '''
netstat -ano | find "8005" > nul
if errorlevel 1 (
echo "Tomcat is not running, skipping shutdown..."
) else (
echo "Tomcat is running, shutting down..."
cd C:\\localhost-tomcat\\apache-tomcat-10.1.36-windows-x64\\apache-tomcat-10.1.36\\bin
call shutdown.bat
ping -n 5 127.0.0.1 > nul
)
copy /Y build\\libs\\*-plain.war C:\\localhost-tomcat\\apache-tomcat-10.1.36-windows-x64\\apache-tomcat-10.1.36\\webapps\\ROOT.war
ping -n 5 127.0.0.1 > nul
cd C:\\localhost-tomcat\\apache-tomcat-10.1.36-windows-x64\\apache-tomcat-10.1.36\\bin
call startup.bat
'''
}
}
}
}