From a84ed04027ebbb87df1c78f7ab6ca92d82fb2a6f Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Fri, 21 Feb 2025 14:13:57 +0900 Subject: [PATCH] 1 --- Jenkinsfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f6bd36..14d705b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,11 +14,21 @@ pipeline { stage('Deploy') { steps { bat ''' + netstat -ano | find "8080" > 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 + timeout /t 5 /nobreak + ) + copy /Y build\\libs\\*-plain.war C:\\localhost-tomcat\\apache-tomcat-10.1.36-windows-x64\\apache-tomcat-10.1.36\\webapps\\ROOT.war timeout /t 5 /nobreak + cd C:\\localhost-tomcat\\apache-tomcat-10.1.36-windows-x64\\apache-tomcat-10.1.36\\bin - call shutdown.bat - timeout /t 5 /nobreak call startup.bat ''' }