From 638fcf25fc7ea597e57d1dab9fa260f7c33d6615 Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Mon, 2 May 2016 01:03:31 -0700 Subject: [PATCH] Fix Publish Delete, ReleaseLease URLs --- scripts/dotnet-cli-build/PublishTargets.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/dotnet-cli-build/PublishTargets.cs b/scripts/dotnet-cli-build/PublishTargets.cs index f9903ed46..5d3f74bc4 100644 --- a/scripts/dotnet-cli-build/PublishTargets.cs +++ b/scripts/dotnet-cli-build/PublishTargets.cs @@ -69,13 +69,16 @@ namespace Microsoft.DotNet.Cli.Build // at the same time and someone already took care of publishing and we have no work to do. if (AzurePublisherTool.IsLatestSpecifiedVersion(targetVersionFile)) { - AzurePublisherTool.ReleaseLeaseOnBlob(targetContainer, leaseId); + AzurePublisherTool.ReleaseLeaseOnBlob(semaphoreBlob, leaseId); return c.Success(); } else { // This is an old drop of latest so remove all old files to ensure a clean state - AzurePublisherTool.ListBlobs($"{targetContainer}").ToList().ForEach(f => AzurePublisherTool.TryDeleteBlob(f)); + AzurePublisherTool.ListBlobs($"{targetContainer}") + .Select(s => s.Replace("/dotnet/", "")) + .ToList() + .ForEach(f => AzurePublisherTool.TryDeleteBlob(f)); // Drop the version file signaling such for any race-condition builds (see above comment). AzurePublisherTool.DropLatestSpecifiedVersion(targetVersionFile);