-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.sonar
More file actions
34 lines (29 loc) · 882 Bytes
/
Jenkinsfile.sonar
File metadata and controls
34 lines (29 loc) · 882 Bytes
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
node {
// Déclaration des variables d'environnement
def SONARQUBE_SERVER = 'https://sonarqube.ambiance-ensitech.me'
def SONAR_TOKEN = credentials('sonar-token')
// Récupération du secret pour le webhook
def secretWebhook = credentials('secret-webhook-sonarqube')
stage('Checkout') {
checkout scm
}
stage('SonarQube Analysis') {
withSonarQubeEnv('SonarQubeServer') {
sh """
sonar-scanner \\
-Dsonar.projectKey=ambiance \\
-Dsonar.projectName=ambiance \\
-Dsonar.host.url=${SONARQUBE_SERVER} \\
-Dsonar.branch.name=
"""
}
}
stage('Quality Gate') {
timeout(time: 5, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
stage('Cleanup') {
cleanWs()
}
}