-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
54 lines (45 loc) · 1.65 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
pipeline {
agent any
options {
// This is required if you want to clean before build with the "Workspace Cleanup Plugin"
skipDefaultCheckout(true)
}
environment {
SONARQUBE_URL = 'https://sonarcloud.io/' // Replace with your SonarQube server URL
MY_PATH='C:\\Users\\archa\\Downloads\\build-wrapper-win-x86\\'
}
stages {
stage('SCM') {
steps {
// Clean before build using the "Workspace Cleanup Plugin"
cleanWs()
checkout scm
}
}
stage('Build') {
steps {
bat '''
mkdir build
set PATH = "%MY_PATH%;%PATH%"
cd C:\\Users\\archa\\Downloads\\build-wrapper-win-x86
start build-wrapper-win-x86 --out-dir bw-output cmake -S -B build
'''
}
}
stage('SonarQube Analysis') {
steps {
script {
def scannerHome = tool 'SonarScanner'; // Name of the SonarQube Scanner you created in "Global Tool Configuration" section
withSonarQubeEnv() {
bat "${scannerHome}/bin/sonar-scanner \
-Dsonar.organization=archanaseru \
-Dsonar.projectKey=archanaseru_linux-cmake-jenkins-sq \
-Dsonar.sources=. \
-Dsonar.cfamily.build-wrapper-output=bw-output \
-Dsonar.host.url=https://sonarcloud.io "
}
}
}
}
}
}