-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentApp_Using_Gradle.groovy
More file actions
58 lines (54 loc) · 1.37 KB
/
Copy pathStudentApp_Using_Gradle.groovy
File metadata and controls
58 lines (54 loc) · 1.37 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Deploying a war file using Gradle and Tomcat 8
pipeline{
agent{
label 'agent1'
}
stages{
stage("Install Gradle")
{
steps{
sh "sudo apt-get update"
sh "sudo apt-get install gradle -y"
}
}
stage('Pull a file from git')
{
steps{
git 'https://github.com/Mayur2905/studentapp-ui.git'
}
}
stage('Build the code')
{
steps{
sh 'gradle clean'
sh 'gradle build'
}
}
stage('Testing the code')
{
steps{
sh 'gradle test'
}
}
stage('Downloading Tomcat 8')
{
steps{
sh 'sudo wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.99/bin/apache-tomcat-8.5.99.tar.gz'
sh 'sudo tar -xvf apache-tomcat-8.5.99.tar.gz'
}
}
// moveing the war file to the tomcat webapps folder
stage('Deploying war file')
{
steps{
sh " sudo mv build/libs/*.war apache-tomcat-8.5.99/webapps/student.war"
}
}
stage('Starting Apache 8')
{
steps{
sh 'sudo ./apache-tomcat-8.5.99/bin/startup.sh'
}
}
}
}