mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 15:55:49 +00:00
Fixed: conditional block syntax
This commit is contained in:
parent
29720eb488
commit
631e79fdf8
1 changed files with 7 additions and 8 deletions
|
@ -13,16 +13,15 @@ pool:
|
||||||
# see: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml
|
# see: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml
|
||||||
name: $(Build.DefinitionName).$(SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)
|
name: $(Build.DefinitionName).$(SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: BuildTestDeploy
|
||||||
variables:
|
variables:
|
||||||
# Sonar scanner does not allow branch name to be set for Pull Requests (PRs), but returns an error if not specified for CI builds.
|
# Sonar scanner does not allow branch name to be set for Pull Requests (PRs), but returns an error if not specified for CI builds.
|
||||||
# This conditional block only passes the branch name if build is not for a PR, otherwise it passes the Sonar PR params:
|
# This conditional block only passes the branch name if build is not for a PR, otherwise it passes the Sonar PR params:
|
||||||
if {{ $[ne(variables['Build.Reason'], 'PullRequest')] }}:
|
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
|
||||||
SonarExtraProperties: 'sonar.branch.name=$(Build.SourceBranchName)'
|
SonarExtraProperties: 'sonar.branch.name=$(Build.SourceBranchName)'
|
||||||
if {{ $[eq(variables['Build.Reason'], 'PullRequest')] }}:
|
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||||
SonarExtraProperties: 'sonar.pullrequest.key=$(System.PullRequest.PullRequestId) sonar.pullrequest.branch=$(Build.SourceBranchName) sonar.pullrequest.base=$(System.PullRequest.TargetBranch)'
|
SonarExtraProperties: 'sonar.pullrequest.key=$(System.PullRequest.PullRequestId) sonar.pullrequest.branch=$(Build.SourceBranchName) sonar.pullrequest.base=$(System.PullRequest.TargetBranch)'
|
||||||
|
|
||||||
jobs:
|
|
||||||
- job: BuildTestDeploy
|
|
||||||
displayName: Build Test and Deploy spring-petclinic Java Web App
|
displayName: Build Test and Deploy spring-petclinic Java Web App
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue