-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (48 loc) · 1.24 KB
/
Jenkinsfile
File metadata and controls
48 lines (48 loc) · 1.24 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
pipeline {
agent any
environment {
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1
}
tools {
dotnetsdk 'dotnet8'
}
stages {
stage('Pre-Build') {
steps {
dotnetRestore()
}
}
stage('Build') {
steps {
dotnetBuild()
}
}
stage('Sonar') {
environment {
scannerHome = tool 'SonarScanner for MSBuild'
}
steps {
withSonarQubeEnv('SonarQube Community') {
sh "dotnet ${scannerHome}/SonarScanner.MSBuild.dll begin /k:'leosac_shared-services_f283ea9d-4131-4d41-ba9a-6e29632e5898'"
dotnetBuild()
sh "dotnet ${scannerHome}/SonarScanner.MSBuild.dll end"
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate(abortPipeline: true)
}
}
when {
anyOf {
branch 'main'
buildingTag()
changeRequest()
}
}
}
stage('Test') {
steps {
dotnetTest()
}
}
}
}