Bamboo variable value is empty in MSBuild scripts

348 Views Asked by At

I have MSBuild script which is used to build our entire application on Bamboo. Configured some global variables in Bamboo & accessing it in MSBuild scripts. Recently added new variables in Bamboo & now am unable to read value from Bamboo variable.

sample script

<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
   <PropertyGroup>
     <ProductName>Test</ProductName>
     <TenantName>UnitTest</TenantName>
     <Platform>x64</Platform>
     <Configuration>Release</Configuration>
     <BuildVersion>$(bamboo_BuildVersionNumber)</BuildVersion>
     <GenerateMultiZDTBinaries>$(Bamboo_EnableMultiZDTZip)</GenerateMultiZDTBinaries>
    <GenerateSingleZDTBinaries>$(Bamboo_EnableSingleZDTZip)</GenerateSingleZDTBinaries>
 </PropertyGroup> 
<Target Name="Build"> 
   <Message Text="Value1: $(GenerateSingleZDTBinaries) and Value2: $(GenerateMultiZDTBinaries) - CONDITION1: '$(GenerateSingleZDTBinaries.Equals('yes', StringComparison.OrdinalIgnoreCase))' - CONDITION2: '$(GenerateSingleZDTBinaries)' == 'yes'" Importance="High" />  
</Target> 
</Project>

Bamboo logs:

Build: build 01-Mar-2021 07:08:24 Value1: and Value2: - CONDITION1: 'False' - CONDITION2: '' == 'yes'

values for the newly added properties have empty but the value for $(bamboo_BuildVersionNumber) is fetched from Bamboo [this variable added very long] which is configured before Bamboo version: 7.1.2 upgrade.

Please some one help me on this.

1

There are 1 best solutions below

0
On

It is fixed by changing the Bamboo plan variable to lower case. previously configured plan variable Bamboo_EnableMultiZDTZip = true. Now i changed to bamboo_EnableMultiZDTZip = true & consumed with

<GenerateMultiZDTBinaries>$(bamboo_EnableMultiZDTZip)</GenerateMultiZDTBinaries>
<GenerateSingleZDTBinaries>$(bamboo_EnableSingleZDTZip)</GenerateSingleZDTBinaries>

I dont know why there is Case sensitive logic.