-
Notifications
You must be signed in to change notification settings - Fork 163
/
template.job.SonarQube.yml
54 lines (45 loc) · 1.72 KB
/
template.job.SonarQube.yml
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
parameters:
name: ''
vmImage: ''
displayName: ''
jobs:
- job: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
pool:
vmImage: ${{ parameters.vmImage }}
# see https://docs.microsoft.com/ja-jp/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#timeouts
timeoutInMinutes: 120
strategy:
maxParallel: 4
matrix:
Win64_Release:
BuildPlatform: 'x64'
Configuration: 'Release'
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
variables:
SONAR_QUBE: Yes
# set condition at https://docs.microsoft.com/ja-jp/azure/devops/pipelines/process/conditions?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml
# see Build.Reason at https://docs.microsoft.com/ja-jp/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
condition:
#and
#(
# ne(variables['Build.Reason'], 'Schedule'),
# ne(variables['Build.Reason'], 'PullRequest')
#)
eq(variables['Build.Reason'], 'Schedule')
steps:
- script: choco install "msbuild-sonarqube-runner" -y
displayName: install msbuild-sonarqube-runner
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
# Build solution with SonarQube
- script: build-sln.bat $(BuildPlatform) $(Configuration)
displayName: Build solution with SonarQube
# see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch&viewFallbackFrom=vsts#secret-variables
env:
SONAR_QUBE_ORG: $(SONAR_QUBE_ORG)
SONAR_QUBE_PROJECT: $(SONAR_QUBE_PROJECT)
SONAR_QUBE_TOKEN: $(SONAR_QUBE_TOKEN)