Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Required variables at queue time

Tags:

azure-devops

When running our Release build (which ultimately labels and versions a changeset), I want the variables to be supplied at queueing time. For example 1.0.23 below:

Queue Build

Is there any way to set these variables as required in order to execute the build?

Build variables

This new "vNext" build platform is incredibly difficult to Google for.

like image 659
Dave New Avatar asked Oct 19 '15 15:10

Dave New


1 Answers

The best I have come up with thus far is to add a task as the first step in the first phase of the build that checks the required variables are set. If any are not, it fails the build.

I use PowerShell for this:

if ([string]::IsNullOrWhitespace($env:Major)) { throw "Major not set" }

This is not ideal, as the build still has to wait to get scheduled on an agent, sync sources, &c. before the validation code runs and fails the build. But, it's still better than building everything just to have, say, packaging (step 14/15) fail because the version wasn't set.

I've opened a feature request on the VSTS UserVoice page asking for "required queue variables".

like image 85
chwarr Avatar answered Nov 06 '22 10:11

chwarr