forked from acadalearning/web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFilePipeline
More file actions
56 lines (56 loc) · 1.2 KB
/
Copy pathJenkinsFilePipeline
File metadata and controls
56 lines (56 loc) · 1.2 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
pipeline{
agent {
label 'Node1'
}
tools {
maven 'Maven3.8.6'
}
options {
timeout (time: 5, unit:"MINUTES")
}
stages {
stage('Cloning'){
steps {
echo 'Cloning from GitHub'
git credentialsId: 'GitHub_Credentials', url: 'https://github.com/johnsonnejo/web-app.git'
echo 'Cloning done'
}
}
stage('Building'){
steps {
echo "packaging our artifact"
sh 'mvn package'
echo "Packing done"
}
}
stage('Testing'){
steps {
echo 'Testing with Sonarqube'
sh 'mvn sonar:sonar'
echo 'Testing done'
}
}
stage('Deploying'){
steps {
echo 'Deploying to nexus'
sh 'mvn deploy'
echo 'Deploying done'
}
}
stage('Approval'){
steps {
echo "Seeking Approval"
timeout(time: 5, unit: "DAYS"){
input message: 'Approve to production'
}
}
}
stage('Tomcat'){
steps {
echo 'Pushing to Tomcat'
deploy adapters: [tomcat9(credentialsId: 'tomcat-cred', path: '', url: 'http://18.210.18.134:8080/')], contextPath: null, war: 'target/web-app.war'
echo 'Done'
}
}
}
}