forked from tahararib/maven-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjenkinsfile10
More file actions
53 lines (51 loc) · 1.34 KB
/
jenkinsfile10
File metadata and controls
53 lines (51 loc) · 1.34 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
pipeline {
agent {
label {label 'master'}
}
stages {
stage('Clone Codebase') {
steps {
echo 'Clone from github'
git (url : 'https://github.com/tahararib/maven-project.git',
branch : 'master', credentialsId : 'cred4github')
}
}
stage('Compile') {
steps {
echo 'Compiling'
withMaven(maven : 'localMaven') {
sh "mvn compile"
}
}
}
stage('Test') {
steps {
echo 'Testing'
withMaven(maven: 'localMaven') {
sh "mvn test"
}
}
}
stage('Build') {
steps {
echo 'Building'
withMaven(maven: 'localMaven') {
sh "mvn -B -DskipTests clean package"
}
}
}
stage('Qualimetry Analysis') {
steps {
echo 'Quality Analysis with SonarQube'
withSonarQubeEnv(installationName: 'sonarServer', credentialsId:'cred4sonar') {
sh "mvn clean package sonar:sonar"
}
}
}
stage('Deploy') {
steps {
echo 'Deploying'
}
}
}
}