Mask the azure storage account and storage container names.

This commit is contained in:
Sridhar Periyasamy 2015-10-27 14:26:50 -07:00
parent 9751f83c99
commit 0dd15611e1

View file

@ -4,10 +4,10 @@ param(
function CheckRequiredVariables
{
if([string]::IsNullOrEmpty($env:DOTNET_BUILD_VERSION))
if([string]::IsNullOrEmpty($env:DOTNET_BUILD_VERSION))
{
return $false
}
}
# this variable is set by the CI system
if([string]::IsNullOrEmpty($env:SASTOKEN))
@ -15,6 +15,18 @@ function CheckRequiredVariables
return $false
}
# this variable is set by the CI system
if([string]::IsNullOrEmpty($env:STORAGE_ACCOUNT))
{
return $false
}
# this variable is set by the CI system
if([string]::IsNullOrEmpty($env:STORAGE_CONTAINER))
{
return $false
}
return $true
}
@ -23,7 +35,7 @@ $Result = CheckRequiredVariables
if(!$Result)
{
# fail silently if the required variables are not available for publishing the file.
# fail silently if the required variables are not available for publishing the file
exit 0
}
@ -46,7 +58,9 @@ elseif([System.IO.Path]::GetExtension($file).ToLower() -eq ".msi")
Write-Host "Uploading $fileName to dotnet feed.."
Invoke-WebRequest -URI "https://dotnetcli.blob.core.windows.net/dotnet/$Folder/$env:DOTNET_BUILD_VERSION/$fileName$env:SASTOKEN" -Method PUT -Headers @{"x-ms-blob-type"="BlockBlob"; "x-ms-date"="2015-10-23";"x-ms-version"="2013-08-15"} -InFile $file
$Upload_URI = "https://$env:STORAGE_ACCOUNT.blob.core.windows.net/$env:STORAGE_CONTAINER/$Folder/$env:DOTNET_BUILD_VERSION/$fileName$env:SASTOKEN"
Invoke-WebRequest -URI $Upload_URI -Method PUT -Headers @{"x-ms-blob-type"="BlockBlob"; "x-ms-date"="2015-10-23";"x-ms-version"="2013-08-15"} -InFile $file
$ReturnCode = $LASTEXITCODE