зеркало из https://github.com/microsoft/Oryx.git
Cleanup: moved few sdk storage strings to constants.yaml (#520)
This commit is contained in:
Родитель
3b4ccf2959
Коммит
2046de9bc7
|
@ -4,3 +4,5 @@ SDK_STORAGE_BASE_URL_KEY_NAME='ORYX_SDK_STORAGE_BASE_URL'
|
|||
DEV_SDK_STORAGE_BASE_URL='https://oryxsdksdev.blob.core.windows.net'
|
||||
PROD_SDK_STORAGE_BASE_URL='https://oryxsdks.blob.core.windows.net'
|
||||
DEFAULT_VERSION_FILE_NAME='defaultVersion.txt'
|
||||
VERSIONS_TO_BUILD_FILE_NAME='versionsToBuild.txt'
|
||||
CONTAINER_METADATA_URL_FORMAT='{0}/{1}?restype=container&comp=list&include=metadata'
|
||||
|
|
|
@ -130,6 +130,8 @@
|
|||
dev-sdk-storage-base-url: https://oryxsdksdev.blob.core.windows.net
|
||||
prod-sdk-storage-base-url: https://oryxsdks.blob.core.windows.net
|
||||
default-version-file-name: defaultVersion.txt
|
||||
versions-to-build-file-name: versionsToBuild.txt
|
||||
container-metadata-url-format: '{0}/{1}?restype=container&comp=list&include=metadata'
|
||||
outputs:
|
||||
- type: shell
|
||||
directory: build
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator
|
|||
.AppendLine("PLATFORM_SETUP_START=$SECONDS")
|
||||
.AppendLine("echo")
|
||||
.AppendLine(
|
||||
$"echo Downloading {platformName} version '{version}' to {versionDirInTemp}...")
|
||||
$"echo Downloading and extracting {platformName} version '{version}' to {versionDirInTemp}...")
|
||||
.AppendLine($"rm -rf {versionDirInTemp}")
|
||||
.AppendLine($"mkdir -p {versionDirInTemp}")
|
||||
.AppendLine($"cd {versionDirInTemp}")
|
||||
|
|
|
@ -32,9 +32,8 @@ namespace Microsoft.Oryx.BuildScriptGenerator
|
|||
var httpClient = _httpClientFactory.CreateClient("general");
|
||||
|
||||
var sdkStorageBaseUrl = GetPlatformBinariesStorageBaseUrl();
|
||||
var blobList = httpClient
|
||||
.GetStringAsync($"{sdkStorageBaseUrl}/{platformName}?restype=container&comp=list&include=metadata")
|
||||
.Result;
|
||||
var url = string.Format(SdkStorageConstants.ContainerMetadataUrlFormat, sdkStorageBaseUrl, platformName);
|
||||
var blobList = httpClient.GetStringAsync(url).Result;
|
||||
var xdoc = XDocument.Parse(blobList);
|
||||
var supportedVersions = new List<string>();
|
||||
|
||||
|
@ -54,7 +53,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator
|
|||
|
||||
// get default version
|
||||
var defaultVersionContent = httpClient
|
||||
.GetStringAsync($"{sdkStorageBaseUrl}/{platformName}/defaultVersion.txt")
|
||||
.GetStringAsync($"{sdkStorageBaseUrl}/{platformName}/{SdkStorageConstants.DefaultVersionFileName}")
|
||||
.Result;
|
||||
|
||||
string defaultVersion = null;
|
||||
|
|
|
@ -8,5 +8,7 @@ namespace Microsoft.Oryx.Common
|
|||
public const string DevSdkStorageBaseUrl = "https://oryxsdksdev.blob.core.windows.net";
|
||||
public const string ProdSdkStorageBaseUrl = "https://oryxsdks.blob.core.windows.net";
|
||||
public const string DefaultVersionFileName = "defaultVersion.txt";
|
||||
public const string VersionsToBuildFileName = "versionsToBuild.txt";
|
||||
public const string ContainerMetadataUrlFormat = "{0}/{1}?restype=container&comp=list&include=metadata";
|
||||
}
|
||||
}
|
|
@ -6,3 +6,5 @@ const SdkStorageBaseUrlKeyName string = "ORYX_SDK_STORAGE_BASE_URL"
|
|||
const DevSdkStorageBaseUrl string = "https://oryxsdksdev.blob.core.windows.net"
|
||||
const ProdSdkStorageBaseUrl string = "https://oryxsdks.blob.core.windows.net"
|
||||
const DefaultVersionFileName string = "defaultVersion.txt"
|
||||
const VersionsToBuildFileName string = "versionsToBuild.txt"
|
||||
const ContainerMetadataUrlFormat string = "{0}/{1}?restype=container&comp=list&include=metadata"
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using Microsoft.Oryx.Common;
|
||||
using Microsoft.Oryx.Integration.Tests;
|
||||
using Microsoft.Oryx.Tests.Common;
|
||||
using Xunit;
|
||||
|
@ -116,11 +117,8 @@ namespace Oryx.Integration.Tests
|
|||
|
||||
private XDocument GetMetadata(string platformName)
|
||||
{
|
||||
var blobList = _httpClient
|
||||
.GetStringAsync(
|
||||
$"{_storageUrl}/{platformName}" +
|
||||
"?restype=container&comp=list&include=metadata")
|
||||
.Result;
|
||||
var url = string.Format(SdkStorageConstants.ContainerMetadataUrlFormat, _storageUrl, platformName);
|
||||
var blobList = _httpClient.GetStringAsync(url).Result;
|
||||
return XDocument.Parse(blobList);
|
||||
}
|
||||
|
||||
|
@ -147,7 +145,7 @@ namespace Oryx.Integration.Tests
|
|||
private string GetDefaultVersionFromContainer(string platformName)
|
||||
{
|
||||
var defaultVersionContent = _httpClient
|
||||
.GetStringAsync($"{_storageUrl}/{platformName}/defaultVersion.txt")
|
||||
.GetStringAsync($"{_storageUrl}/{platformName}/{SdkStorageConstants.DefaultVersionFileName}")
|
||||
.Result;
|
||||
|
||||
string defaultVersion = null;
|
||||
|
@ -169,7 +167,11 @@ namespace Oryx.Integration.Tests
|
|||
|
||||
private List<string> GetListOfVersionsToBuild(string platformName)
|
||||
{
|
||||
var versionFile = Path.Combine(_repoRootDir, "platforms", platformName, "versionsToBuild.txt");
|
||||
var versionFile = Path.Combine(
|
||||
_repoRootDir,
|
||||
"platforms",
|
||||
platformName,
|
||||
SdkStorageConstants.VersionsToBuildFileName);
|
||||
if (!File.Exists(versionFile))
|
||||
{
|
||||
throw new InvalidOperationException($"Could not find file '{versionFile}'");
|
||||
|
@ -196,7 +198,11 @@ namespace Oryx.Integration.Tests
|
|||
|
||||
private string GetDefaultVersion(string platformName)
|
||||
{
|
||||
var file = Path.Combine(_repoRootDir, "platforms", platformName, "defaultVersion.txt");
|
||||
var file = Path.Combine(
|
||||
_repoRootDir,
|
||||
"platforms",
|
||||
platformName,
|
||||
SdkStorageConstants.DefaultVersionFileName);
|
||||
if (!File.Exists(file))
|
||||
{
|
||||
throw new InvalidOperationException($"Could not file default version file '{file}'.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче