-
Notifications
You must be signed in to change notification settings - Fork 468
/
Jenkinsfile
34 lines (33 loc) · 1.11 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
node{
def tomcatWeb = 'D:\\Auto_deployment\\apache-tomcat-9.0.30\\apache-tomcat-9.0.30\\webapps'
def tomcatBin = 'D:\\Auto_deployment\\apache-tomcat-9.0.30\\apache-tomcat-9.0.30\\bin'
def tomcatStatus = ''
stage('SCM Checkout'){
git 'https://github.com/sivajavatechie/JenkinsWar.git'
}
stage('Compile-Package-create-war-file'){
// Get maven home path
def mvnHome = tool name: 'maven-3', type: 'maven'
bat "${mvnHome}/bin/mvn package"
}
/* stage ('Stop Tomcat Server') {
bat ''' @ECHO OFF
wmic process list brief | find /i "tomcat" > NUL
IF ERRORLEVEL 1 (
echo Stopped
) ELSE (
echo running
"${tomcatBin}\\shutdown.bat"
sleep(time:10,unit:"SECONDS")
)
'''
}*/
stage('Deploy to Tomcat'){
bat "copy target\\JenkinsWar.war \"${tomcatWeb}\\JenkinsWar.war\""
}
stage ('Start Tomcat Server') {
sleep(time:5,unit:"SECONDS")
bat "${tomcatBin}\\startup.bat"
sleep(time:100,unit:"SECONDS")
}
}