-
Notifications
You must be signed in to change notification settings - Fork 165
/
build-sonar-qube-start.bat
37 lines (33 loc) · 1.05 KB
/
build-sonar-qube-start.bat
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
@rem to ensure hide variable SONAR_QUBE_TOKEN
call %~dp0build-sonar-qube-env.bat
if "%SonarScanner_MSBUILD%" == "" (
echo do nothing
exit /b 0
)
if "%SONAR_QUBE_TOKEN%" == "" (
echo do nothing
exit /b 0
)
curl %URL_BUILDWRAPPER_ZIP% -o %BUILDWRAPPER_ZIP%
if errorlevel 1 (
echo ERROR in download from %URL_BUILDWRAPPER_ZIP%
exit /b 1
)
call %~dp0tools\zip\unzip.bat %BUILDWRAPPER_ZIP% %BUILDWRAPPER_DIR%
if exist .sonarqube rmdir /s /q .sonarqube
@echo NUMBER_OF_PROCESSORS : %NUMBER_OF_PROCESSORS%
@rem to ensure hide variable SONAR_QUBE_TOKEN
@echo off
"%SonarScanner_MSBUILD%" begin ^
/k:"%SONAR_QUBE_PROJECT%" ^
/o:"%SONAR_QUBE_ORG%" ^
/d:sonar.cfamily.build-wrapper-output=%~dp0bw-output ^
/d:sonar.cfamily.threads=%NUMBER_OF_PROCESSORS% ^
/d:sonar.sourceEncoding=UTF-8 ^
/d:sonar.host.url="https://sonarcloud.io" ^
/d:sonar.login="%SONAR_QUBE_TOKEN%"
if errorlevel 1 (
echo ERROR in %SonarScanner_MSBUILD% begin errorlevel %errorlevel%
exit /b 1
)
exit /b 0