Given the following yml snippet, the Azure DevOps Pipeline predefined variables used in this script don't get 'picked up'.
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
trigger:
branches:
include:
- master
paths:
include:
<snipped>
pr:
autoCancel: false
paths:
include:
<snipped>
steps:
# Remove this task once .NET Core 2.2 is added to hosted agent.
- task: DotNetCoreInstaller@0
inputs:
packageType: 'sdk'
version: '2.2.100'
- script: dotnet build --configuration $(buildConfiguration) -p:Version=$(Year:yyyy).$(Month).$(DayOfMonth).$(Rev:r)
displayName: 'dotnet build'
workingDirectory: 'src/<snipped>'
Notice how i'm trying to set the version property of a dotnet build
:
dotnet build --configuration $(buildConfiguration) -p:Version=$(Year:yyyy).$(Month).$(DayOfMonth).$(Rev:r)
BUT! when I manually define the build name .. and then reference that variable .. it works!
name: $(Year:yyyy).$(Month).$(DayOfMonth).$(Rev:r)
<snipped>
- script: dotnet build --configuration $(buildConfiguration) -p:Version=$(Build.BuildNumber)
displayName: 'dotnet build'
workingDirectory: 'src/<snipped>'
is this a bug with Azure DevOps?