forked from etechDevops/module4_ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
62 lines (60 loc) · 1.54 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
56
57
58
59
60
61
pipeline{
agent any
tools { maven 'maven'}
stages{
stage('git-clone'){
steps{
checkout([$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'githubpassword', url: 'https://github.com/rnfor-pro/module2_ci']]])
}
}
stage('etech-hello'){
steps{
sh 'git version'
sh 'mvn -v'
}
}
stage('Build Artifact - Maven') {
steps {
sh "mvn clean package -DskipTests=true"
archive 'target/*.jar'
}
}
stage('Unit Tests - JUnit and JaCoCo') {
steps {
sh 'mvn test'
}
post {
always {
junit 'target/surefire-reports/*.xml'
jacoco execPattern: 'target/jacoco.exec'
}
}
}
stage('Mutation Tests - PIT') {
steps {
sh "mvn org.pitest:pitest-maven:mutationCoverage"
}
post {
always {
pitmutation mutationStatsFile: '**/target/pit-reports/**/mutations.xml'
}
}
}
stage('CodeQuality-SAST'){
steps{
sh 'mvn clean verify sonar:sonar \
-Dsonar.projectKey=etechspringapp \
-Dsonar.host.url=http://etechlabs.eastus.cloudapp.azure.com:9000 \
-Dsonar.login=01e6afa1885429be4fc842badeb6b471e94176e1'
}
}
stage('CodeQuality-SAST'){
steps{
sh 'mvn clean verify sonar:sonar \
-Dsonar.projectKey=etechspringapp \
-Dsonar.host.url=http://etechlabs.eastus.cloudapp.azure.com:9000 \
-Dsonar.login=01e6afa1885429be4fc842badeb6b471e94176e1'
}
}
}
}