Merge pull request #3678 from eerhardt/FixPublish

Fixing AzurePublisher to upload files to the correct URL.
This commit is contained in:
Eric Erhardt 2016-06-22 16:38:06 -05:00 committed by GitHub
commit 17e6667d9f
2 changed files with 9 additions and 4 deletions

View file

@ -239,7 +239,7 @@ namespace Microsoft.DotNet.Cli.Build
var packageName = CliMonikers.GetSdkDebianPackageName(c);
var installerFile = c.BuildContext.Get<string>("SdkInstallerFile");
var uploadUrl = AzurePublisher.CalculateUploadUrlForFile(installerFile, AzurePublisher.Product.Sdk, version);
var uploadUrl = AzurePublisher.CalculateFullUrlForFile(installerFile, AzurePublisher.Product.Sdk, version);
DebRepoPublisherTool.PublishDebFileToDebianRepo(
packageName,

View file

@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Cli.Build
public string UploadFile(string file, Product product, string version)
{
string url = CalculateUploadUrlForFile(file, product, version);
string url = CalculateRelativePathForFile(file, product, version);
CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(url);
blob.UploadFromFileAsync(file, FileMode.Open).Wait();
SetBlobPropertiesBasedOnFileType(blob);
@ -194,9 +194,14 @@ namespace Microsoft.DotNet.Cli.Build
_blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait();
}
public static string CalculateUploadUrlForFile(string file, Product product, string version)
public static string CalculateFullUrlForFile(string file, Product product, string version)
{
return $"{s_dotnetBlobRootUrl}/{product}/{version}/{Path.GetFileName(file)}";
return $"{s_dotnetBlobRootUrl}/{CalculateRelativePathForFile(file, product, version)}";
}
private static string CalculateRelativePathForFile(string file, Product product, string version)
{
return $"{product}/{version}/{Path.GetFileName(file)}";
}
public static async Task DownloadFile(string blobFilePath, string localDownloadPath)