According to the official documentation at https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops-2019 the Azure DevOps Server 2019 on-prem supports everything.
Yet, I cannot make it work with a simple yaml template with parameters.
Here is my yaml template (named prepare-sonar-qube.yml):
parameters:
- name: projectKey
type: string
- name: projectName
type: string
default: ${{ parameters.projectKey }}
- name: useDotCover
type: boolean
default: false
steps:
- template: install-java.yml
- task: SonarQubePrepare@4
displayName: 'Prepare SQ Analysis'
inputs:
SonarQube: 'SonarQube'
scannerMode: 'MSBuild'
projectKey: parameters.projectKey
projectName: parameters.projectName
${{ if parameters.useDotCover }}:
extraProperties: |
sonar.cs.dotcover.reportsPaths=$(Common.TestResultsDirectory)\coverage\*.CoverageResult.html
sonar.inclusions=**/*.cs
${{ if !parameters.useDotCover }}:
extraProperties: |
sonar.cs.opencover.reportsPaths=$(Common.TestResultsDirectory)\coverage\*.CoverageResult.xml
sonar.inclusions=**/*.cs
Here is the azure-pipelines.yml:
trigger:
- master
name: 1.0.$(Date:yy)$(DayOfYear)$(Rev:.r)
jobs:
- job: Build
pool:
demands: DotNetFramework
workspace:
clean: all
variables:
- template: variables.yml
steps:
- template: prepare-sonar-qube.yml
parameters:
projectKey: logs2db
...
Running the build I get the following lovely error message:
/prepare-sonar-qube.yml (Line: 2, Col: 1): A sequence was not expected
So what am I doing wrong? (Besides being a loyal TFS customer who got stuck with an outdated on-prem Azure DevOps Server 2019 that does not seem to go anywhere when compared against the ever evolving hosted Azure DevOps Services)