Fix Publish Delete, ReleaseLease URLs

This commit is contained in:
Piotr Puszkiewicz 2016-05-02 01:03:31 -07:00
parent 0bfd94e998
commit 638fcf25fc

View file

@ -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);