-
Notifications
You must be signed in to change notification settings - Fork 24
/
Jenkinsfile
55 lines (55 loc) · 2.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline{
agent any
stages{
stage('---setup---'){
steps{
sh "sudo rm -rf /var/lib/wildfly-10.1.0.Final/standalone/deployments/*"
}
}
stage('---clean---'){
steps{
sh "pwd"
sh "ls"
sh "mvn clean -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--package--'){
steps{
sh "mvn package -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--deploy--'){
steps{
sh "cd /"
sh "pwd"
sh "sudo cp /var/lib/jenkins/workspace/${JOB_NAME}/Java/target/Yoga.war /var/lib/wildfly-10.1.0.Final/standalone/deployments/"
}
}
stage('--test--'){
steps{
sh "mvn test -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--sonar--'){
steps{
sh "mvn sonar:sonar -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--verify--'){
steps{
sh "mvn verify -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--surefire--'){
steps{
sh "mvn surefire-report:report -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
sh "mvn site -f /var/lib/jenkins/workspace/${JOB_NAME}/Java"
}
}
stage('--email--'){
steps{
emailext attachLog: true, attachmentsPattern: 'target/site/jacoco/index.html, target/site/surefire-report.html', body: '', subject: '', to: 'ayshamarty@gmail.com'
}
}
}
}