forked from sauravhathi/jpg-to-png
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (30 loc) · 916 Bytes
/
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
pipeline {
agent any
triggers{
pollSCM('*/5 * * * *')
}
stages {
stage('Fetch Code') {
steps {
// Checkout code from GitHub
git branch: 'master', url: 'https://github.com/alihamza372/jpg_to_png.git'
}
}
stage('Deploy to Tomcat') {
steps {
// Copy files to Tomcat webapps directory
script {
def tomcatWebappsDir = '/opt/tomcat/webapps/Image-converter_jpg-to-png'
sh "sudo rm -rf ${tomcatWebappsDir}/*"
sh "sudo cp -r * ${tomcatWebappsDir}/"
}
}
}
stage('Restart Tomcat') {
steps {
// Restart Tomcat (replace 'tomcat' with your Tomcat service name)
sh 'sudo systemctl restart tomcat'
}
}
}
}