-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdockerJenkinsFile
33 lines (33 loc) · 1.13 KB
/
dockerJenkinsFile
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
pipeline {
agent {
docker {
image 'sonarsource/sonar-scanner-cli:latest'
// args '-v $HOME/.sonar/cache:/root/.m2:z -v $HOME/.sonar/cache:/opt/sonar-scanner/.sonar/cache:z -u root'
args '-v sonarcache:/opt/sonar-scanner/.sonar/cache:z -u root'
reuseNode true
}
}
options {
skipStagesAfterUnstable()
}
stages {
stage('Analysis') {
steps {
withSonarQubeEnv(installationName: 'SYCOLATEST') {
script {
sh "sonar-scanner -Dsonar.projectKey=github-docker-sonar-training-app -Donar.projectName=github-docker-sonar-training-app"
}
}
}
}
stage("Quality Gate") {
steps {
timeout(time: 5, unit: 'MINUTES') {
// Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails
// true = set pipeline to UNSTABLE, false = don't
waitForQualityGate abortPipeline: false
}
}
}
}
}