Merge pull request #8388 from johnbeisner/OrchestratedBuildPublishing

Enabling the publish of CLI assets to 'orchestrated' blob storage.
This commit is contained in:
Matt Mitchell 2018-01-12 19:33:28 -08:00 committed by GitHub
commit 2cfc65a0c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 21 deletions

View file

@ -1,27 +1,36 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Product>Sdk</Product>
<IsOrchestratedPublish Condition="'$(PB_PublishBlobFeedUrl)' != ''">True</IsOrchestratedPublish>
<BlobStoragePartialRelativePath>Sdk</BlobStoragePartialRelativePath>
<!-- Values related to the download of assets from blob storage -->
<DefaultCoreSetupBlobRootUrl>https://dotnetcli.azureedge.net/dotnet/</DefaultCoreSetupBlobRootUrl>
<CoreSetupBlobRootUrl Condition="'$(PB_AssetRootUrl)' != ''">$(PB_AssetRootUrl)</CoreSetupBlobRootUrl>
<CoreSetupBlobRootUrl>$(PB_AssetRootUrl)</CoreSetupBlobRootUrl>
<CoreSetupBlobRootUrl Condition="'$(CoreSetupBlobRootUrl)' == ''">$(DefaultCoreSetupBlobRootUrl)</CoreSetupBlobRootUrl>
<BackwardsCompatibilityCoreSetupBlobRootUrl>$(DefaultCoreSetupBlobRootUrl)</BackwardsCompatibilityCoreSetupBlobRootUrl>
<CoreSetupBlobAccessToken Condition="'$(PB_AssetRootAccessTokenSuffix)' != ''">$(PB_AssetRootAccessTokenSuffix)</CoreSetupBlobAccessToken>
<CoreSetupBlobAccessTokenParam Condition=" '$(CoreSetupBlobAccessToken)' != '' ">?$(CoreSetupBlobAccessToken)</CoreSetupBlobAccessTokenParam>
<ArtifactContainerName>$(ARTIFACT_STORAGE_CONTAINER)</ArtifactContainerName>
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
<ArtifactCloudDropAccessToken>$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
<!-- Values related to the upload of assets to blob storage -->
<ArtifactCloudDropAccountName>$(ARTIFACT_STORAGE_ACCOUNT)</ArtifactCloudDropAccountName>
<ArtifactCloudDropAccountName Condition="'$(ArtifactCloudDropAccountName)' == ''">dotnetcli</ArtifactCloudDropAccountName>
<DotnetBlobRootUrl>https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)</DotnetBlobRootUrl>
<ChecksumContainerName>$(CHECKSUM_STORAGE_CONTAINER)</ChecksumContainerName>
<ChecksumContainerName Condition="'$(ChecksumContainerName)' == ''">dotnet</ChecksumContainerName>
<ChecksumCloudDropAccessToken>$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>
<ArtifactContainerName>$(ARTIFACT_STORAGE_CONTAINER)</ArtifactContainerName>
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
<ArtifactCloudDropAccessToken>$(PB_PublishBlobFeedKey)</ArtifactCloudDropAccessToken>
<ArtifactCloudDropAccessToken Condition="'$(ArtifactCloudDropAccessToken)' == ''">$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
<!-- Values related to the upload of checksums to blob storage -->
<ChecksumCloudDropAccountName>$(CHECKSUM_STORAGE_ACCOUNT)</ChecksumCloudDropAccountName>
<ChecksumCloudDropAccountName Condition="'$(ChecksumCloudDropAccountName)' == ''">dotnetclichecksums</ChecksumCloudDropAccountName>
<BlobFeedContainerName>$(BLOBFEED_STORAGE_CONTAINER)</BlobFeedContainerName>
<BlobFeedContainerName Condition="'$(BlobFeedContainerName)' == ''">dotnet-core</BlobFeedContainerName>
<BlobFeedExpectedURL>$(BLOBFEED_EXPECTED_URL)</BlobFeedExpectedURL>
<BlobFeedExpectedURL Condition="'$(BlobFeedExpectedURL)' == ''">https://dotnetfeed.blob.core.windows.net/$(BlobFeedContainerName)/index.json</BlobFeedExpectedURL>
<BlobFeedCloudDropAccessToken>$(BLOBFEED_STORAGE_KEY)</BlobFeedCloudDropAccessToken>
<ChecksumContainerName>$(CHECKSUM_STORAGE_CONTAINER)</ChecksumContainerName>
<ChecksumContainerName Condition="'$(ChecksumContainerName)' == ''">dotnet</ChecksumContainerName>
<ChecksumCloudDropAccessToken>$(PB_PublishBlobFeedKey)</ChecksumCloudDropAccessToken>
<ChecksumCloudDropAccessToken Condition="'$(ChecksumCloudDropAccessToken)' == ''">$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>
<!-- Values related to the upload of NuPkgs to the blob feed -->
<BlobFeedExpectedURL>$(PB_PublishBlobFeedUrl)</BlobFeedExpectedURL>
<BlobFeedExpectedURL Condition="'$(BlobFeedExpectedURL)' == ''">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</BlobFeedExpectedURL>
<BlobFeedCloudDropAccessToken>$(PB_PublishBlobFeedKey)</BlobFeedCloudDropAccessToken>
<BlobFeedCloudDropAccessToken Condition="'$(BlobFeedCloudDropAccessToken)' == ''">$(BLOBFEED_STORAGE_KEY)</BlobFeedCloudDropAccessToken>
</PropertyGroup>
</Project>

View file

@ -68,7 +68,7 @@
<PropertyGroup>
<VersionToolsVersion>1.0.27-prerelease-01723-01</VersionToolsVersion>
<DotnetDebToolVersion>2.0.0-preview2-25331-01</DotnetDebToolVersion>
<BuildTasksFeedToolVersion>2.1.0-prerelease-02221-02</BuildTasksFeedToolVersion>
<BuildTasksFeedToolVersion>2.1.0-prerelease-02312-02</BuildTasksFeedToolVersion>
</PropertyGroup>
</Project>

View file

@ -4,6 +4,7 @@
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishContent.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishNupkgToBlobFeed.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/AzureInfo.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/RuntimeCoherence.targets" />
@ -12,6 +13,7 @@
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
DependsOnTargets="Init;
SetBadgeProps;
SetAzureProps;
Package;
EvaluateRuntimeCoherence;
PublishArtifacts;
@ -21,6 +23,7 @@
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
DependsOnTargets="Init;
SetBadgeProps;
SetAzureProps;
EvaluateRuntimeCoherence;
PublishArtifacts;
FinishBuild" />
@ -43,16 +46,16 @@
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)"
Condition=" '$(PublishArchives)' == 'true' "/>
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg"
Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' == 'true' AND '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
<ForPublishing Include="$(PackagesDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).*.nupkg"
Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' == 'true' AND '$(OS)' == 'Windows_NT' "/>
Condition=" '$(OS)' == 'Windows_NT' "/>
<ForPublishing Include="$(PackagesDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.*.nupkg"
Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' == 'true' AND '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
</ItemGroup>
<ItemGroup>
<ForPublishing>
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
</ForPublishing>
</ItemGroup>
</Target>
@ -66,7 +69,7 @@
<ItemGroup>
<CliVersionBadgeToUpload>
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
</CliVersionBadgeToUpload>
</ItemGroup>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetAzureProps"
Condition=" '$(IsOrchestratedPublish)' == 'True' And '$(PB_PublishBlobFeedUrl)' != '' ">
<ParseFeedUrl FeedUrl="$(PB_PublishBlobFeedUrl)">
<Output TaskParameter="BlobElements" ItemName="BlobElements" />
</ParseFeedUrl>
<PropertyGroup>
<ArtifactContainerName>%(BlobElements.ContainerName)</ArtifactContainerName>
<ChecksumContainerName>%(BlobElements.ContainerName)</ChecksumContainerName>
<ArtifactCloudDropAccountName>%(BlobElements.AccountName)</ArtifactCloudDropAccountName>
<ChecksumCloudDropAccountName>%(BlobElements.AccountName)</ChecksumCloudDropAccountName>
<PublishBlobFeedUrlBlobPath>%(BlobElements.BaseBlobPath)</PublishBlobFeedUrlBlobPath>
<BlobStoragePartialRelativePath>$(PublishBlobFeedUrlBlobPath.Replace('/index.json', ''))/assets</BlobStoragePartialRelativePath>
</PropertyGroup>
</Target>
</Project>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="FinishBuild"
Condition="'$(IsOrchestratedPublish)' != 'True'"
DependsOnTargets="CheckIfAllBuildsHavePublished;
FinalizeBuild" />

View file

@ -7,7 +7,7 @@
<NupkgsForPublishing Include="$(PackagesDirectory)/Microsoft.DotNet.MSBuildSdkResolver.*.nupkg" />
</ItemGroup>
<Target Name="PublishNupkgToBlobFeed" Condition=" '$(PUBLISH_NUPKG_TO_BLOB_FEED)' == 'true' AND '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' " >
<Target Name="PublishNupkgToBlobFeed" Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' " >
<Error Condition="'$(BlobFeedCloudDropAccessToken)' == ''" Text="Missing property BlobFeedCloudDropAccessToken." />
<Error Condition="'$(BlobFeedExpectedURL)' == ''" Text="Missing property BlobFeedExpectedURL." />