Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 9dc9f4c

Browse files
author
jbeisner
committed
Use "PushToBlobFeed" instead of "UploadToAzure"
1 parent 552129d commit 9dc9f4c

File tree

10 files changed

+82
-93
lines changed

10 files changed

+82
-93
lines changed

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj
3636
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(GitCommitInfoProps)" />
3737
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(HostInfoProps)" />
3838
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(BuildInfoProps)" />
39-
39+
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(NuGetPackagesDir)/microsoft.dotnet.build.tasks.feed/$(BuildTasksFeedToolVersion)/build/Microsoft.DotNet.Build.Tasks.Feed.targets" />
40+
4041
<Import Project="build/BranchInfo.props" />
4142
<Import Project="build/AzureInfo.props" />
4243

build/AzureInfo.props

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
33
<Product>Sdk</Product>
4-
<IsOrchestratedPublish Condition="'$(PB_PublishBlobFeedUrl)' != ''">True</IsOrchestratedPublish>
5-
<BlobStoragePartialRelativePath>$(Product)</BlobStoragePartialRelativePath>
4+
<IsOrchestratedPublish Condition="'$(PB_PublishBlobFeedUrl)' != ''">true</IsOrchestratedPublish>
65

76
<!-- Values related to the download of assets from blob storage -->
87
<DefaultCoreSetupBlobRootUrl>https://dotnetcli.azureedge.net/dotnet/</DefaultCoreSetupBlobRootUrl>
@@ -19,6 +18,8 @@
1918
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
2019
<ArtifactCloudDropAccessToken>$(PB_PublishBlobFeedKey)</ArtifactCloudDropAccessToken>
2120
<ArtifactCloudDropAccessToken Condition="'$(ArtifactCloudDropAccessToken)' == ''">$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
21+
<ArtifactCloudDropURL>$(PB_PublishBlobFeedUrl)</ArtifactCloudDropURL>
22+
<ArtifactCloudDropURL Condition="'$(PB_PublishBlobFeedUrl)' == ''">"https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)/"</ArtifactCloudDropURL>
2223

2324
<!-- Values related to the upload of checksums to blob storage -->
2425
<ChecksumCloudDropAccountName>$(CHECKSUM_STORAGE_ACCOUNT)</ChecksumCloudDropAccountName>
@@ -27,11 +28,13 @@
2728
<ChecksumContainerName Condition="'$(ChecksumContainerName)' == ''">dotnet</ChecksumContainerName>
2829
<ChecksumCloudDropAccessToken>$(PB_PublishBlobFeedKey)</ChecksumCloudDropAccessToken>
2930
<ChecksumCloudDropAccessToken Condition="'$(ChecksumCloudDropAccessToken)' == ''">$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>
30-
31+
<ChecksumCloudDropURL>$(PB_PublishBlobFeedUrl)</ChecksumCloudDropURL>
32+
<ChecksumCloudDropURL Condition="'$(PB_PublishBlobFeedUrl)' == ''">"https://$(ChecksumCloudDropAccountName).blob.core.windows.net/$(ChecksumContainerName)/"</ChecksumCloudDropURL>
33+
3134
<!-- Values related to the upload of NuPkgs to the blob feed -->
3235
<BlobFeedExpectedURL>$(PB_PublishBlobFeedUrl)</BlobFeedExpectedURL>
3336
<BlobFeedExpectedURL Condition="'$(BlobFeedExpectedURL)' == ''">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</BlobFeedExpectedURL>
3437
<BlobFeedCloudDropAccessToken>$(PB_PublishBlobFeedKey)</BlobFeedCloudDropAccessToken>
3538
<BlobFeedCloudDropAccessToken Condition="'$(BlobFeedCloudDropAccessToken)' == ''">$(BLOBFEED_STORAGE_KEY)</BlobFeedCloudDropAccessToken>
36-
</PropertyGroup>
39+
</PropertyGroup>
3740
</Project>

build/DependencyVersions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<PropertyGroup>
6969
<VersionToolsVersion>1.0.27-prerelease-01723-01</VersionToolsVersion>
7070
<DotnetDebToolVersion>2.0.0-preview2-25331-01</DotnetDebToolVersion>
71-
<BuildTasksFeedToolVersion>2.1.0-prerelease-02312-02</BuildTasksFeedToolVersion>
71+
<BuildTasksFeedToolVersion>2.1.0-prerelease-02411-04</BuildTasksFeedToolVersion>
7272
</PropertyGroup>
7373

7474
</Project>

build/InitRepo.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>
88
<OrchestratedPackageVersionsProps>$(GeneratedPropsDir)/OrchestratedPackageVersionsProps.props</OrchestratedPackageVersionsProps>
99
<GeneratedNuGetConfig>$(RepoRoot)/NuGet.Config</GeneratedNuGetConfig>
10-
1110
</PropertyGroup>
1211
</Project>

build/Publish.targets

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishContent.targets" />
55
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishNupkgToBlobFeed.targets" />
66
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
7-
<Import Project="$(MSBuildThisFileDirectory)/publish/AzureInfo.targets" />
87
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
98
<Import Project="$(MSBuildThisFileDirectory)/publish/RuntimeCoherence.targets" />
109

@@ -13,7 +12,6 @@
1312
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
1413
DependsOnTargets="Init;
1514
SetBadgeProps;
16-
SetAzureProps;
1715
Package;
1816
EvaluateRuntimeCoherence;
1917
PublishArtifacts;
@@ -23,7 +21,6 @@
2321
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
2422
DependsOnTargets="Init;
2523
SetBadgeProps;
26-
SetAzureProps;
2724
EvaluateRuntimeCoherence;
2825
PublishArtifacts;
2926
FinishBuild" />
@@ -39,8 +36,7 @@
3936
PublishNupkgToBlobFeed;
4037
PublishCliVersionBadge" />
4138

42-
<Target Name="GatherItemsForPattern"
43-
DependsOnTargets="SetAzureProps">
39+
<Target Name="GatherItemsForPattern">
4440
<ItemGroup>
4541
<ForPublishing Include="@(GeneratedInstallers)"
4642
Condition=" '$(PublishNativeInstallers)' == 'true' "/>
@@ -56,13 +52,15 @@
5652

5753
<ItemGroup>
5854
<ForPublishing>
59-
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
55+
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
6056
</ForPublishing>
6157
</ItemGroup>
6258
</Target>
6359

64-
<Target Name="PublishCliVersionBadge"
65-
DependsOnTargets="SetAzureProps">
60+
<Target Name="PublishCliVersionBadge">
61+
<Error Condition="'$(ArtifactCloudDropAccessToken)' == ''" Text="Missing property ArtifactCloudDropAccessToken." />
62+
<Error Condition="'$(ArtifactCloudDropURL)' == ''" Text="Missing property ArtifactCloudDropURL." />
63+
6664
<ItemGroup>
6765
<CliVersionBadgeToUpload Include="$(VersionBadge)" />
6866
<CliVersionBadgeToUpload Include="$(CoherentBadge)"
@@ -71,21 +69,15 @@
7169

7270
<ItemGroup>
7371
<CliVersionBadgeToUpload>
74-
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
72+
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
7573
</CliVersionBadgeToUpload>
7674
</ItemGroup>
7775

78-
<UploadToAzure
79-
AccountKey="$(ArtifactCloudDropAccessToken)"
80-
AccountName="$(ArtifactCloudDropAccountName)"
81-
ContainerName="$(ArtifactContainerName)"
82-
Items="@(CliVersionBadgeToUpload)"
83-
Overwrite="$(OverwriteOnPublish)" />
76+
<Message Text="Publish badges to blob feed started: " />
77+
<PushToBlobFeed AccountKey="$(ArtifactCloudDropAccessToken)"
78+
ExpectedFeedUrl="$(ArtifactCloudDropURL)"
79+
ItemsToPush="@(CliVersionBadgeToUpload)"
80+
Overwrite="false" />
8481

85-
<SetBlobPropertiesBasedOnFileType
86-
AccountKey="$(ArtifactCloudDropAccessToken)"
87-
AccountName="$(ArtifactCloudDropAccountName)"
88-
ContainerName="$(ArtifactContainerName)"
89-
Items="@(CliVersionBadgeToUpload)" />
9082
</Target>
9183
</Project>

build/publish/AzureInfo.targets

Lines changed: 0 additions & 21 deletions
This file was deleted.

build/publish/FinishBuild.targets

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,61 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Target Name="FinishBuild"
4-
Condition="'$(IsOrchestratedPublish)' != 'True'"
5-
DependsOnTargets="CheckIfAllBuildsHavePublished;
4+
Condition="'$(IsOrchestratedPublish)' != 'true'"
5+
DependsOnTargets="SetArtifactBlobProps;
6+
SetChecksumBlobProps;
7+
CheckIfAllBuildsHavePublished;
68
FinalizeBuild" />
79

10+
<Target Name="SetArtifactBlobProps">
11+
<Error Condition="'$(ArtifactCloudDropURL)' == ''" Text="Missing property ArtifactCloudDropURL." />
12+
13+
<ParseBlobUrl FeedUrl="$(ArtifactCloudDropURL)">
14+
<Output TaskParameter="BlobElements" ItemName="BlobElements" />
15+
</ParseBlobUrl>
16+
17+
<PropertyGroup>
18+
<ArtifactBlobContainerName>%(BlobElements.ContainerName)</ArtifactBlobContainerName>
19+
<ArtifactBlobAccountName>%(BlobElements.AccountName)</ArtifactBlobAccountName>
20+
</PropertyGroup>
21+
</Target>
22+
23+
<Target Name="SetChecksumBlobProps">
24+
<Error Condition="'$(ChecksumCloudDropURL)' == ''" Text="Missing property ChecksumCloudDropURL." />
25+
26+
<ParseBlobUrl FeedUrl="$(ChecksumCloudDropURL)">
27+
<Output TaskParameter="BlobElements" ItemName="BlobElements" />
28+
</ParseBlobUrl>
29+
30+
<PropertyGroup>
31+
<ChecksumBlobContainerName>%(BlobElements.ContainerName)</ChecksumBlobContainerName>
32+
<ChecksumBlobAccountName>%(BlobElements.AccountName)</ChecksumBlobAccountName>
33+
</PropertyGroup>
34+
</Target>
35+
36+
837
<Target Name="CheckIfAllBuildsHavePublished">
938
<CheckIfAllBuildsHavePublished AccountKey="$(ArtifactCloudDropAccessToken)"
10-
AccountName="$(ArtifactCloudDropAccountName)"
11-
ContainerName="$(ArtifactContainerName)"
39+
AccountName="$(ArtifactBlobAccountName)"
40+
ContainerName="$(ArtifactBlobContainerName)"
1241
NugetVersion="$(FullNugetVersion)"
1342
VersionBadgeMoniker="$(VersionBadgeMoniker)">
1443
<Output TaskParameter="HaveAllBuildsPublished" PropertyName="HaveAllBuildsPublished" />
1544
</CheckIfAllBuildsHavePublished>
1645
</Target>
17-
18-
<Target Name="FinalizeBuild"
19-
Condition=" '$(HaveAllBuildsPublished)' == 'True' ">
20-
<CopyBlobsToLatest AccountName="$(ArtifactCloudDropAccountName)"
46+
47+
<Target Name="FinalizeBuild" Condition=" '$(HaveAllBuildsPublished)' == 'True' ">
48+
<CopyBlobsToLatest AccountName="$(ArtifactBlobAccountName)"
2149
AccountKey="$(ArtifactCloudDropAccessToken)"
22-
ContainerName="$(ArtifactContainerName)"
50+
ContainerName="$(ArtifactBlobContainerName)"
2351
NugetVersion="$(FullNugetVersion)"
2452
Channel="$(Channel)"
2553
CommitHash="$(CommitHash)"
2654
Coherent="$(Coherent)" />
2755

28-
<CopyBlobsToLatest AccountName="$(ChecksumCloudDropAccountName)"
56+
<CopyBlobsToLatest AccountName="$(ChecksumBlobAccountName)"
2957
AccountKey="$(ChecksumCloudDropAccessToken)"
30-
ContainerName="$(ChecksumContainerName)"
58+
ContainerName="$(ChecksumBlobContainerName)"
3159
NugetVersion="$(FullNugetVersion)"
3260
Channel="$(Channel)"
3361
CommitHash="$(CommitHash)"

build/publish/PublishContent.targets

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,26 @@
2121

2222
<!-- publishes artifacts to blob storage in Azure -->
2323
<Target Name="UploadArtifactsToAzure" DependsOnTargets="GatherItemsForPattern">
24-
<Error Condition="'$(ArtifactContainerName)' == ''" Text="Missing property ArtifactContainerName." />
25-
<Error Condition="'$(ArtifactCloudDropAccountName)' == ''" Text="Missing property ArtifactCloudDropAccountName." />
2624
<Error Condition="'$(ArtifactCloudDropAccessToken)' == ''" Text="Missing property ArtifactCloudDropAccessToken." />
27-
<!-- create the container if it doesn't exist -->
28-
<CreateAzureContainer
29-
AccountKey="$(ArtifactCloudDropAccessToken)"
30-
AccountName="$(ArtifactCloudDropAccountName)"
31-
ContainerName="$(ArtifactContainerName)" />
32-
<!-- now upload the items -->
33-
<UploadToAzure
34-
AccountKey="$(ArtifactCloudDropAccessToken)"
35-
AccountName="$(ArtifactCloudDropAccountName)"
36-
ContainerName="$(ArtifactContainerName)"
37-
Items="@(ForPublishing)"
38-
Overwrite="$(OverwriteOnPublish)" />
25+
<Error Condition="'$(ArtifactCloudDropURL)' == ''" Text="Missing property ArtifactCloudDropURL." />
26+
27+
<Message Text="Publish assets to blob storage started: $(ArtifactCloudDropURL)" />
28+
<PushToBlobFeed AccountKey="$(ArtifactCloudDropAccessToken)"
29+
ExpectedFeedUrl="$(ArtifactCloudDropURL)"
30+
ItemsToPush="@(ForPublishing)"
31+
Overwrite="$(OverwriteOnPublish)" />
3932
</Target>
4033

4134
<!-- publishes checksums for the artifacts to blob storage in Azure -->
4235
<Target Name="UploadChecksumsToAzure" DependsOnTargets="GenerateChecksums">
43-
<Error Condition="'$(ChecksumContainerName)' == ''" Text="Missing property ChecksumContainerName." />
44-
<Error Condition="'$(ChecksumCloudDropAccountName)' == ''" Text="Missing property ChecksumCloudDropAccountName." />
4536
<Error Condition="'$(ChecksumCloudDropAccessToken)' == ''" Text="Missing property ChecksumCloudDropAccessToken." />
46-
<!-- create the container if it doesn't exist -->
47-
<CreateAzureContainer
48-
AccountKey="$(ChecksumCloudDropAccessToken)"
49-
AccountName="$(ChecksumCloudDropAccountName)"
50-
ContainerName="$(ChecksumContainerName)" />
51-
<!-- now upload the items -->
52-
<UploadToAzure
53-
AccountKey="$(ChecksumCloudDropAccessToken)"
54-
AccountName="$(ChecksumCloudDropAccountName)"
55-
ContainerName="$(ChecksumContainerName)"
56-
Items="@(ArtifactsForGeneratingChecksums->'%(DestinationPath)')"
57-
Overwrite="$(OverwriteOnPublish)" />
37+
<Error Condition="'$(ChecksumCloudDropURL)' == ''" Text="Missing property ChecksumCloudDropURL." />
38+
39+
<Message Text="Publish checksums to blob storage started: $(ChecksumCloudDropURL)" />
40+
<PushToBlobFeed AccountKey="$(ChecksumCloudDropAccessToken)"
41+
ExpectedFeedUrl="$(ChecksumCloudDropURL)"
42+
ItemsToPush="@(ArtifactsForGeneratingChecksums->'%(DestinationPath)')"
43+
Overwrite="$(OverwriteOnPublish)" />
5844
</Target>
5945

60-
</Project>
46+
</Project>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Condition="'$(GeneratePropsFile)' != 'true'" Project="$(NuGetPackagesDir)/microsoft.dotnet.build.tasks.feed/$(BuildTasksFeedToolVersion)/build/Microsoft.DotNet.Build.Tasks.Feed.targets" />
4-
53
<ItemGroup>
64
<NupkgsForPublishing Include="$(PackagesDirectory)/Microsoft.DotNet.Cli.Utils.*.nupkg" />
75
<NupkgsForPublishing Include="$(PackagesDirectory)/Microsoft.DotNet.MSBuildSdkResolver.*.nupkg" />
@@ -13,8 +11,8 @@
1311

1412
<Message Text="Publish NuPkgs to Blob feed started" />
1513
<PushToBlobFeed AccountKey="$(BlobFeedCloudDropAccessToken)"
16-
ExpectedFeedUrl="$(BlobFeedExpectedURL)"
17-
ItemsToPush="@(NupkgsForPublishing)"
18-
Overwrite="false" />
14+
ExpectedFeedUrl="$(BlobFeedExpectedURL)"
15+
ItemsToPush="@(NupkgsForPublishing)"
16+
Overwrite="false" />
1917
</Target>
2018
</Project>

scripts/dockerrun.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,8 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
136136
-e AZUREACCOUNTNAME \
137137
-e RELEASETOOLSGITURL \
138138
-e CORESETUPBLOBROOTURL \
139+
-e PB_AssetRootUrl \
140+
-e PB_PackageVersionPropsUrl \
141+
-e PB_PublishBlobFeedUrl \
139142
$DOTNET_BUILD_CONTAINER_TAG \
140143
$BUILD_COMMAND "$@"

0 commit comments

Comments
 (0)