-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
86 lines (75 loc) · 2.8 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
pipeline {
agent any
environment {
customImage = null
}
tools {
// Install latest Maven "Maven 3.8.5 JENKINS"
maven "Maven 3.8.5 JENKINS"
// Install latest JDK "OpenJDK 17"
jdk "OpenJDK 17"
}
stages {
stage('GIT Download') {
steps {
echo 'Git download'
/**
* Landing Page Bitbucket
*/
git branch: 'develop',
credentialsId: 'GITHUB_GEOMANCER86',
url: 'https://github.com/Geomancer86/Futtoboru.git'
}
}
stage("Test"){
steps {
// Run Maven on a Unix agent.
wrap([$class: 'Xvfb']) {
sh "mvn -Dmaven.test.failure.ignore=true clean package"
sh "mvn -Dmaven.test.failure.ignore=true test"
}
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit 'futtoboru-core/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'futtoboru-desktop/target/*.jar'
echo "Maven Build Archive Artifacts Done"
}
}
}
stage("Test Reports") {
steps {
dir('futtoboru-core') {
jacoco(
execPattern: 'target/*.exec',
classPattern: 'target/classes',
sourcePattern: 'src/main/java',
exclusionPattern: 'src/test*',
changeBuildStatus: true,
runAlways: true,
minimumBranchCoverage: '0'
)
}
}
}
stage('Sonar') {
steps {
echo 'Sonar Analysis'
//wrap([$class: 'Xvfb', screen: '1920x1080x32']) {
wrap([$class: 'Xvfb']) {
// Run Sonar
sh "mvn clean verify -Djacoco.skip=false sonar:sonar -Dsonar.projectKey=FuttoboruDEV -Dsonar.host.url=http://192.168.0.102:9000 -Dsonar.login=7860635e27b1b05389584bbc0e6c73f077a4631e"
}
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
echo "Sonar Gateway Passed"
}
}
}
}
}