forked from TarekMESSAOUDI/Timesheet_DevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
59 lines (50 loc) · 998 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
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
59
pipeline{
agent any
stages{
stage ('Checkout GIT'){
steps{
echo 'Pulling...';
git branch: 'master',
url : 'https://github.com/username/Timesheet_DevOps';
}
}
stage ("Verification du version Maven"){
steps{
bat """mvn -version"""
}
}
stage ("Suppression du dossier tareget + Copie du livrable dans le Repository local"){
steps{
bat """mvn clean install"""
}
}
stage ("Lancement des Tests Unitaires"){
steps{
bat """mvn test"""
}
}
stage ("Création du livrable dans target"){
steps{
bat """mvn package"""
}
}
stage ("Analyse avec Sonar"){
steps{
bat """mvn sonar:sonar"""
}
}
/*stage ("Deploiement dans http://localhost:8081/repository/maven-releases/ "){
steps{
bat """mvn deploy"""
}
}*/
}
post{
success{
emailext body: 'Build success', subject: 'Jenkins', to:'t@gmail.tn'
}
failure{
emailext body: 'Build failure', subject: 'Jenkins', to:'t@gmail.tn'
}
}
}