0

I want to define variable version_ that consists of other my variables, like this: image

but variables major, minor, versionCounter and branchPrefix aren't recognized, and this syntax is just transformed into string

I tried to use $(major) syntax, but it also didn't work. How can I fix it?

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • Hey, welcome on SO. Can you next time paste code instead of the screen. It helps a lot on providing an answer. – Krzysztof Madej Aug 02 '21 at 11:06
  • 1
    for some reason stackoverflow adds auxiliary characters when code is pasted, making it less readable, if it's fixed, i'll past code in future – Andrii Dusheba Aug 11 '21 at 09:40

2 Answers2

0

To set a pipeline variable you can use the echo ##vso syntax:

  - bash: |
      echo "##vso[task.setvariable variable=initialBuild]$(Build.BuildNumber)"
    displayName: Save initial build number

or PowerShell

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=initialBuild]$(Build.BuildNumber)"
    displayName: Save initial build number
Kai Walter
  • 3,485
  • 2
  • 32
  • 62
0

Please change ${{ }} syntax on branchPrefix and version_ to $[], however on condition with if you should have ${{ }}.

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107