forked from tahararib/maven-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjenkinsFile7
More file actions
58 lines (53 loc) · 1.42 KB
/
jenkinsFile7
File metadata and controls
58 lines (53 loc) · 1.42 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
pipeline {
agent { label 'maven'}
stages {
stage('Clone Codebase') {
steps {
echo 'Clone Codebase from github'
git 'https://github.com/tahararib/maven-project.git'
}
}
stage('Compile') {
steps {
echo 'Compiling project'
withMaven(maven:'localMaven')
{
sh "mvn compile"
}
}
}
stage('Unit Tests') {
steps {
echo 'Testingt'
withMaven(maven:'localMaven')
{
sh "mvn test"
}
}
}
stage('Analysis With SonarQube') {
steps {
echo 'Qualimetry Analysis'
withSonarQubeEnv(installationName:'SonarServer' ,
credentialsId: 'cred4sonar')
{
sh "mvn clean package sonar:sonar "
}
}
}
stage('Build Project') {
steps {
echo 'Packagingt'
withMaven(maven:'localMaven')
{
sh "mvn -B -DskipTests clean package"
}
}
}
stage('Deploy Artefact') {
steps {
echo 'Deploying project'
}
}
}
}