Use more consistent manifest attributes (#39360)
authorMatt Mitchell <mmitche@microsoft.com>
Wed, 15 Jul 2020 23:41:53 +0000 (16:41 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Jul 2020 23:41:53 +0000 (16:41 -0700)
Create manifest attributes that are consistent with arcade's usage.

src/installer/publish/prepare-artifacts.proj

index 1bf2b52..bd2abcc 100644 (file)
@@ -7,6 +7,33 @@
     <SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
   </PropertyGroup>
 
+  <!-- Pulled from arcade's publish.proj see https://github.com/dotnet/arcade/issues/5790 for
+       issue on making this common in arcade so it doesn't have to be duplicated here -->
+  <PropertyGroup>
+    <CollectionUri>$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)</CollectionUri>
+
+    <!-- When we have dev.azure.com/<account>/ -->
+    <AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('dev.azure.com')) >= 0">$(CollectionUri.Split('/')[3])</AzureDevOpsAccount>
+
+    <!-- When we have <account>.visualstudio.com -->
+    <AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('visualstudio.com')) >= 0">$(CollectionUri.Split('.')[0].Split('/')[2])</AzureDevOpsAccount>
+  </PropertyGroup>
+
+  <!--
+    The new Maestro/BAR build model keeps separate Azure DevOps and GitHub build information.
+    The GitHub information will be extracted based on the Azure DevOps repository.
+  -->
+  <ItemGroup>
+    <ManifestBuildData Include="InitialAssetsLocation=$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$(SYSTEM_TEAMPROJECT)/_apis/build/builds/$(BUILD_BUILDID)/artifacts" />
+    <ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
+    <ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
+    <ManifestBuildData Include="AzureDevOpsAccount=$(AzureDevOpsAccount)" />
+    <ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
+    <ManifestBuildData Include="AzureDevOpsBuildNumber=$(BUILD_BUILDNUMBER)" />
+    <ManifestBuildData Include="AzureDevOpsRepository=$(BUILD_REPOSITORY_URI)" />
+    <ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
+  </ItemGroup>
+
   <Target Name="CreateChecksums">
     <ItemGroup>
       <ArtifactsForGeneratingChecksums
@@ -60,7 +87,7 @@
     <!-- Push items to AzDO as build artifacts, generating the asset manifest as a side effect. -->
     <PushToAzureDevOpsArtifacts
       ItemsToPush="@(ItemsToPush)"
-      ManifestBuildData="Location=$(ExpectedFeedUrl)"
+      ManifestBuildData="@(ManifestBuildData)"
       ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
       ManifestBranch="$(BUILD_SOURCEBRANCH)"
       ManifestBuildId="$(BUILD_BUILDNUMBER)"
     <!-- Push items to AzDO as build artifacts, generating the asset manifest as a side effect. -->
     <PushToAzureDevOpsArtifacts
       ItemsToPush="@(ItemsToPush)"
-      ManifestBuildData="Location=$(ExpectedFeedUrl)"
+      ManifestBuildData="@(ManifestBuildData)"
       ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
       ManifestBranch="$(BUILD_SOURCEBRANCH)"
       ManifestBuildId="$(BUILD_BUILDNUMBER)"