Novastorm
Novastorm

Reputation: 1458

How to use Visual Studio Online variables?

Visual Studio Online now supports the use of variables; allowing users to set values to a variable and then reference that variable elsewhere (ei in our case, we're using them for builds).

Currently we're operating a branching and merging strategy, so each release we increment the version number by 0.1 (v1.1, v1.2, etc). We've designated a CurrentBranch variable that holds this version information, however when this variable is referenced it isn't being picked up correctly and the build fails.

It almost looks like it's looking for the actual value (CurrentBranch) in our build, rather than the value which is stored in the CurrentBranch variable. It is being set in the following way:

enter image description here

And referenced in the repository tab under mappings:

enter image description here

I've tried various uses of the variable include (CurrentBranch) and $(CurrentBranch) with the same result. How can I make use of my variables in my mappings?

Upvotes: 1

Views: 504

Answers (1)

Daniel Mann
Daniel Mann

Reputation: 58980

Workspace mappings don't support variables. You can use it in the actual build task, though... it may make more sense to map the workspace such that it downloads everything and cloak the folders you aren't interested in building that represent older versions. It requires a bit of periodic maintenance, but so does updating a $(CurrentVersion) variable.

Upvotes: 1

Related Questions