Add downloading of runtime assets from dotnetbuilds

This commit is contained in:
Alex Perovich 2021-10-14 12:13:40 -07:00
parent 973613e911
commit 1e9a661bbb
3 changed files with 22 additions and 18 deletions

View file

@ -36,9 +36,11 @@ variables:
- ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-MSRC-Storage - group: DotNet-MSRC-Storage
- group: DotNetBuilds storage account read tokens
- name: _InternalRuntimeDownloadArgs - name: _InternalRuntimeDownloadArgs
value: /p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet value: /p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet
/p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64) /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64)
/p:dotnetbuilds-internal-container-read-token-base64=$(dotnetbuilds-internal-container-read-token-base64)
stages: stages:
- stage: build - stage: build

View file

@ -31,11 +31,8 @@
<BuildCommandArgs Condition="'$(TargetOS)' == 'OSX'">$(BuildCommandArgs) /p:CoreSetupRid=osx-x64</BuildCommandArgs> <BuildCommandArgs Condition="'$(TargetOS)' == 'OSX'">$(BuildCommandArgs) /p:CoreSetupRid=osx-x64</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:CoreSetupRid=$(TargetRid)</BuildCommandArgs> <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:CoreSetupRid=$(TargetRid)</BuildCommandArgs>
<!-- Consume the source-built Core-Setup. This line must be removed to source-build CLI without source-building Core-Setup first. --> <!-- Consume the source-built Core-Setup and toolset. This line must be removed to source-build CLI without source-building Core-Setup first. -->
<BuildCommandArgs>$(BuildCommandArgs) /p:CoreSetupBlobRootUrl=file:%2F%2F$(SourceBuiltAssetsDir)</BuildCommandArgs> <BuildCommandArgs>$(BuildCommandArgs) /p:PublicBaseURL=file:%2F%2F$(SourceBuiltAssetsDir)</BuildCommandArgs>
<!-- location to pick up the toolset binaries from. This must be removed to source-build core-sdk without building toolset first -->
<BuildCommandArgs>$(BuildCommandArgs) /p:DotnetToolsetBlobRootUrl=file:%2F%2F$(SourceBuiltAssetsDir)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:UsePortableLinuxSharedFramework=false</BuildCommandArgs> <BuildCommandArgs>$(BuildCommandArgs) /p:UsePortableLinuxSharedFramework=false</BuildCommandArgs>

View file

@ -34,9 +34,7 @@
<InternalBuild Condition="$(SYSTEM_TEAMPROJECT) == 'internal'">true</InternalBuild> <InternalBuild Condition="$(SYSTEM_TEAMPROJECT) == 'internal'">true</InternalBuild>
<InternalBaseURL Condition="$(SYSTEM_TEAMPROJECT) == 'internal'">https://dotnetclimsrc.blob.core.windows.net/dotnet/</InternalBaseURL> <InternalBaseURL Condition="$(SYSTEM_TEAMPROJECT) == 'internal'">https://dotnetclimsrc.blob.core.windows.net/dotnet/</InternalBaseURL>
<CoreSetupBlobRootUrl Condition="'$(CoreSetupBlobRootUrl)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</CoreSetupBlobRootUrl> <PublicBaseURL Condition="'$(PublicBaseURL)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</PublicBaseURL>
<DotnetExtensionsBlobRootUrl Condition="'$(DotnetExtensionsBlobRootUrl)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</DotnetExtensionsBlobRootUrl>
<DotnetToolsetBlobRootUrl Condition="'$(DotnetToolsetBlobRootUrl)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</DotnetToolsetBlobRootUrl>
<CoreSetupRid Condition="'$(CoreSetupRid)' == ''">$(HostRid)</CoreSetupRid> <CoreSetupRid Condition="'$(CoreSetupRid)' == ''">$(HostRid)</CoreSetupRid>
<CoreSetupRid Condition=" ('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd') and '$(DotNetBuildFromSource)' != 'true' ">$(OSName)-$(Architecture)</CoreSetupRid> <CoreSetupRid Condition=" ('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd') and '$(DotNetBuildFromSource)' != 'true' ">$(OSName)-$(Architecture)</CoreSetupRid>
@ -104,11 +102,11 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<CoreSetupRootUrl>$(CoreSetupBlobRootUrl)Runtime/</CoreSetupRootUrl> <CoreSetupRootUrl>$(PublicBaseURL)Runtime/</CoreSetupRootUrl>
<CoreSetupRootUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(CoreSetupBlobRootUrl)</CoreSetupRootUrl> <CoreSetupRootUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(PublicBaseURL)</CoreSetupRootUrl>
<AspNetCoreSharedFxRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/Runtime/</AspNetCoreSharedFxRootUrl> <AspNetCoreSharedFxRootUrl>$(PublicBaseURL)aspnetcore/Runtime/</AspNetCoreSharedFxRootUrl>
<AspNetCoreSharedFxRootUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(CoreSetupBlobRootUrl)</AspNetCoreSharedFxRootUrl> <AspNetCoreSharedFxRootUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(PublicBaseURL)</AspNetCoreSharedFxRootUrl>
<WinFormsAndWpfSharedFxRootUrl>$(CoreSetupBlobRootUrl)WindowsDesktop/</WinFormsAndWpfSharedFxRootUrl> <WinFormsAndWpfSharedFxRootUrl>$(PublicBaseURL)WindowsDesktop/</WinFormsAndWpfSharedFxRootUrl>
<CoreSetupDownloadDirectory>$(IntermediateDirectory)/coreSetupDownload/$(MicrosoftNETCoreAppRuntimePackageVersion)</CoreSetupDownloadDirectory> <CoreSetupDownloadDirectory>$(IntermediateDirectory)/coreSetupDownload/$(MicrosoftNETCoreAppRuntimePackageVersion)</CoreSetupDownloadDirectory>
<CombinedSharedHostAndFrameworkArchive>$(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension)</CombinedSharedHostAndFrameworkArchive> <CombinedSharedHostAndFrameworkArchive>$(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension)</CombinedSharedHostAndFrameworkArchive>
</PropertyGroup> </PropertyGroup>
@ -245,8 +243,8 @@
</BundledInstallerComponent> </BundledInstallerComponent>
<BundledLayoutComponent Include="ToolsetArchive"> <BundledLayoutComponent Include="ToolsetArchive">
<BaseUrl>$(DotnetToolsetBlobRootUrl)Sdk/$(MicrosoftDotnetToolsetInternalPackageVersion)</BaseUrl> <BaseUrl>$(PublicBaseURL)Sdk/$(MicrosoftDotnetToolsetInternalPackageVersion)</BaseUrl>
<BaseUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(DotnetToolsetBlobRootUrl)</BaseUrl> <BaseUrl Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildOffline)' == 'true' ">$(PublicBaseURL)</BaseUrl>
<DownloadFileName>dotnet-toolset-internal-$(MicrosoftDotnetToolsetInternalPackageVersion).zip</DownloadFileName> <DownloadFileName>dotnet-toolset-internal-$(MicrosoftDotnetToolsetInternalPackageVersion).zip</DownloadFileName>
<RelativeLayoutPath>sdk/$(Version)</RelativeLayoutPath> <RelativeLayoutPath>sdk/$(Version)</RelativeLayoutPath>
</BundledLayoutComponent> </BundledLayoutComponent>
@ -344,9 +342,7 @@
Replaces the public base url with the private one. Replaces the public base url with the private one.
--> -->
<PrivateBaseUrl>%(BaseUrl)</PrivateBaseUrl> <PrivateBaseUrl>%(BaseUrl)</PrivateBaseUrl>
<PrivateBaseUrl Condition="'$(InternalBuild)' == 'true'">$([System.String]::new('%(ComponentToDownload.PrivateBaseUrl)').Replace('$(CoreSetupBlobRootUrl)', '$(InternalBaseURL)'))</PrivateBaseUrl> <PrivateBaseUrl Condition="'$(InternalBuild)' == 'true'">$([System.String]::new('%(ComponentToDownload.PrivateBaseUrl)').Replace('$(PublicBaseURL)', '$(InternalBaseURL)'))</PrivateBaseUrl>
<PrivateBaseUrl Condition="'$(InternalBuild)' == 'true'">$([System.String]::new('%(ComponentToDownload.PrivateBaseUrl)').Replace('$(DotnetExtensionsBlobRootUrl)', '$(InternalBaseURL)'))</PrivateBaseUrl>
<PrivateBaseUrl Condition="'$(InternalBuild)' == 'true'">$([System.String]::new('%(ComponentToDownload.PrivateBaseUrl)').Replace('$(DotnetToolsetBlobRootUrl)', '$(InternalBaseURL)'))</PrivateBaseUrl>
</ComponentToDownload> </ComponentToDownload>
<!-- Now transform the group of components into a list of Uris, <!-- Now transform the group of components into a list of Uris,
@ -358,11 +354,20 @@
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload> <ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload>
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination> <DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination>
</UrisToDownload> </UrisToDownload>
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.BaseUrl)').Replace('https://dotnetcli.blob.core.windows.net/dotnet/', 'https://dotnetbuilds.blob.core.windows.net/public/'))/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true'">
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload>
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination>
</UrisToDownload>
<UrisToDownload Include="%(ComponentToDownload.PrivateBaseUrl)/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != ''"> <UrisToDownload Include="%(ComponentToDownload.PrivateBaseUrl)/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != ''">
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload> <ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload>
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination> <DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination>
<token>$(DotNetRuntimeSourceFeedKey)</token> <token>$(DotNetRuntimeSourceFeedKey)</token>
</UrisToDownload> </UrisToDownload>
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.PrivateBaseUrl)').Replace('https://dotnetclimsrc.blob.core.windows.net/dotnet/', 'https://dotnetbuilds.blob.core.windows.net/internal/'))/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != ''">
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload>
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination>
<token>$(dotnetbuilds-internal-container-read-token-base64)</token>
</UrisToDownload>
</ItemGroup> </ItemGroup>
<DownloadFile Condition=" '@(UrisToDownload)' != '' and %(ShouldDownload)" <DownloadFile Condition=" '@(UrisToDownload)' != '' and %(ShouldDownload)"