Update publish scripts to support a sub-container (#1408)
This commit is contained in:
Родитель
c34068a86b
Коммит
6547af7e9a
|
@ -50,7 +50,7 @@
|
|||
"typescript": "2.5.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/applicationinsights-analytics-js": "2.5.9",
|
||||
"@microsoft/applicationinsights-channel-js": "2.5.9",
|
||||
|
|
|
@ -8,7 +8,8 @@ param (
|
|||
[switch] $showFiles = $false, # Show the individual files with details as well
|
||||
[switch] $inclExt = $false, # Include the extensions
|
||||
[switch] $activeOnly = $false, # Only show the active (deployed) versions
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -28,6 +29,7 @@ Function Log-Params
|
|||
Log "Log Path : $logDir"
|
||||
Log "Show Files: $showFiles"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($global:sasToken) -eq $true) {
|
||||
Log "Mode : User-Credentials"
|
||||
|
@ -418,6 +420,11 @@ Function GetContainerContext(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
|
||||
# Use the Users Storage Context credentials
|
||||
|
@ -477,6 +484,35 @@ Function GetVersionFiles(
|
|||
}
|
||||
}
|
||||
|
||||
Function HasMetaTag(
|
||||
$blob,
|
||||
[string] $metaKey
|
||||
) {
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ieq $metaKey) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
Function GetMetaTagValue(
|
||||
$blob,
|
||||
[string] $metaKey
|
||||
) {
|
||||
$value = ""
|
||||
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ieq $metaKey) {
|
||||
$value = $blob.ICloudBlob.Metadata[$dataKey]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return $value
|
||||
}
|
||||
|
||||
Function ListVersions(
|
||||
[system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]] $files
|
||||
) {
|
||||
|
@ -514,8 +550,9 @@ Function ListVersions(
|
|||
$pathList = ""
|
||||
foreach ($theBlob in $fileList) {
|
||||
$thePath = $theBlob.path
|
||||
if ($theBlob.blob.ICloudBlob.Metadata.ContainsKey($metaSdkSrc)) {
|
||||
$version = GetVersion $theBlob.blob.ICloudBlob.Metadata[$metaSdkSrc]
|
||||
if (HasMetaTag($theBlob, $metaSdkSrc)) {
|
||||
$sdkVer = GetMetaTagValue $theBlob $metaSdkSrc
|
||||
$version = GetVersion $sdkVer
|
||||
$thePath = "$($version.path)$($version.prefix)$($version.ver)"
|
||||
}
|
||||
|
||||
|
@ -538,7 +575,7 @@ Function ListVersions(
|
|||
foreach ($theBlob in $fileList) {
|
||||
$blob = $theBlob.blob
|
||||
$blob.ICloudBlob.FetchAttributes()
|
||||
$sdkVersion = $blob.ICloudBlob.Metadata[$metaSdkVer]
|
||||
$sdkVersion = GetMetaTagValue $blob $metaSdkVer
|
||||
if ([string]::IsNullOrWhiteSpace($sdkVersion) -ne $true) {
|
||||
$sdkVersion = "v$sdkVersion"
|
||||
} else {
|
||||
|
@ -547,7 +584,7 @@ Function ListVersions(
|
|||
|
||||
$metaTags = ""
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ne $metaSdkVer) {
|
||||
if ($dataKey -ine $metaSdkVer) {
|
||||
$metaTags = "$metaTags$dataKey=$($blob.ICloudBlob.Metadata[$dataKey]); "
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@ param (
|
|||
[string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login
|
||||
[string] $logPath = $null, # The location where logs should be written
|
||||
[switch] $overwrite = $false, # Overwrite any existing files
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -24,6 +25,7 @@ Function Log-Params
|
|||
Log "Store Path: $cdnStorePath"
|
||||
Log "Overwrite : $overwrite"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
Log "SourcePath: $jsSdkDir"
|
||||
Log "Log Path : $logDir"
|
||||
|
||||
|
@ -340,6 +342,11 @@ Function PublishFiles(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
Log " Using Cache Control: $cacheControlValue"
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ param (
|
|||
[string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login
|
||||
[string] $logPath = $null, # The location where logs should be written
|
||||
[switch] $minorOnly = $false, # Only set the active minor version (v2.x) and not the major version (v2)
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -27,6 +28,7 @@ Function Log-Params
|
|||
Log "Version : $activeVersion"
|
||||
Log "Store Path: $cdnStorePath"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
Log "Log Path : $logDir"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($global:sasToken) -eq $true) {
|
||||
|
@ -418,6 +420,11 @@ Function GetContainerContext(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
|
||||
# Use the Users Storage Context credentials
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/applicationinsights-common": "2.5.9",
|
||||
"@microsoft/applicationinsights-channel-js": "2.5.9",
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"sinon": "^7.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/applicationinsights-core-js": "2.5.9",
|
||||
"@microsoft/applicationinsights-common": "2.5.9"
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
}
|
||||
},
|
||||
"@microsoft/dynamicproto-js": {
|
||||
"version": "1.0.1",
|
||||
"from": "@microsoft/dynamicproto-js@^1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.0.1.tgz"
|
||||
"version": "1.1.0",
|
||||
"from": "@microsoft/dynamicproto-js@^1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.0.tgz"
|
||||
},
|
||||
"@nodelib/fs.scandir": {
|
||||
"version": "2.1.3",
|
||||
|
@ -150,9 +150,9 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz"
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.11.3",
|
||||
"version": "14.11.10",
|
||||
"from": "@types/node@*",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.3.tgz"
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.10.tgz"
|
||||
},
|
||||
"@types/qunit": {
|
||||
"version": "2.9.5",
|
||||
|
@ -175,9 +175,9 @@
|
|||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz"
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.12.5",
|
||||
"version": "6.12.6",
|
||||
"from": "ajv@^6.12.3",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz"
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
|
@ -2056,9 +2056,9 @@
|
|||
"resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.4.tgz",
|
||||
"dependencies": {
|
||||
"uglify-js": {
|
||||
"version": "3.11.1",
|
||||
"version": "3.11.2",
|
||||
"from": "uglify-js@^3.4.9",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.1.tgz"
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.2.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -2415,9 +2415,9 @@
|
|||
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz"
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.13.0",
|
||||
"version": "1.14.1",
|
||||
"from": "tslib@^1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz"
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
|
||||
},
|
||||
"tslint": {
|
||||
"version": "5.20.1",
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/applicationinsights-core-js": "2.5.9",
|
||||
"@microsoft/applicationinsights-common": "2.5.9"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-common": "2.5.9",
|
||||
"@microsoft/applicationinsights-core-js": "2.5.9",
|
||||
"@microsoft/applicationinsights-shims": "1.0.3"
|
||||
|
|
|
@ -7,7 +7,8 @@ param (
|
|||
[string] $logPath = $null, # The location where logs should be written
|
||||
[switch] $showFiles = $false, # Show the individual files with details as well
|
||||
[switch] $activeOnly = $false, # Only show the active (deployed) versions
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -27,6 +28,7 @@ Function Log-Params
|
|||
Log "Log Path : $logDir"
|
||||
Log "Show Files: $showFiles"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($global:sasToken) -eq $true) {
|
||||
Log "Mode : User-Credentials"
|
||||
|
@ -417,6 +419,11 @@ Function GetContainerContext(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
|
||||
# Use the Users Storage Context credentials
|
||||
|
@ -477,6 +484,35 @@ Function GetVersionFiles(
|
|||
}
|
||||
}
|
||||
|
||||
Function HasMetaTag(
|
||||
$blob,
|
||||
[string] $metaKey
|
||||
) {
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ieq $metaKey) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
Function GetMetaTagValue(
|
||||
$blob,
|
||||
[string] $metaKey
|
||||
) {
|
||||
$value = ""
|
||||
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ieq $metaKey) {
|
||||
$value = $blob.ICloudBlob.Metadata[$dataKey]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return $value
|
||||
}
|
||||
|
||||
Function ListVersions(
|
||||
[system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]] $files
|
||||
) {
|
||||
|
@ -513,16 +549,23 @@ Function ListVersions(
|
|||
$pathList = ""
|
||||
foreach ($theBlob in $fileList) {
|
||||
$thePath = $theBlob.path
|
||||
if (HasMetaTag($theBlob, $metaSdkSrc)) {
|
||||
$sdkVer = GetMetaTagValue $theBlob $metaSdkSrc
|
||||
$version = GetVersion $sdkVer
|
||||
$thePath = "$($version.path)$($version.prefix)$($version.ver)"
|
||||
}
|
||||
|
||||
if ($paths.ContainsKey($thePath) -ne $true) {
|
||||
$paths[$thePath] = $true
|
||||
if ($theBlob.blob.ICloudBlob.Metadata.ContainsKey($metaSdkSrc)) {
|
||||
$value = "{0,-20}" -f $theBlob.blob.ICloudBlob.Metadata[$metaSdkSrc]
|
||||
$pathList = "$pathList$value "
|
||||
} else {
|
||||
$value = "{0,-20}" -f $thePath
|
||||
$pathList = "$pathList$value "
|
||||
} else {
|
||||
$paths[$thePath] = ($paths[$thePath] + 1)
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($thePath in $paths.Keys | Sort-Object) {
|
||||
Log $(" - {1,-40} ({0})" -f $paths[$thePath],$thePath)
|
||||
}
|
||||
|
||||
Log $("v{0,-12} ({1,2}) - {2}" -f $key,$($fileList.Count),$pathList.Trim())
|
||||
|
@ -531,7 +574,7 @@ Function ListVersions(
|
|||
foreach ($theBlob in $fileList) {
|
||||
$blob = $theBlob.blob
|
||||
$blob.ICloudBlob.FetchAttributes()
|
||||
$sdkVersion = $blob.ICloudBlob.Metadata[$metaSdkVer]
|
||||
$sdkVersion = GetMetaTagValue $blob $metaSdkVer
|
||||
if ([string]::IsNullOrWhiteSpace($sdkVersion) -ne $true) {
|
||||
$sdkVersion = "v$sdkVersion"
|
||||
} else {
|
||||
|
@ -540,7 +583,7 @@ Function ListVersions(
|
|||
|
||||
$metaTags = ""
|
||||
foreach ($dataKey in $blob.ICloudBlob.Metadata.Keys) {
|
||||
if ($dataKey -ne $metaSdkVer) {
|
||||
if ($dataKey -ine $metaSdkVer) {
|
||||
$metaTags = "$metaTags$dataKey=$($blob.ICloudBlob.Metadata[$dataKey]); "
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@ param (
|
|||
[string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login
|
||||
[string] $logPath = $null, # The location where logs should be written
|
||||
[switch] $overwrite = $false, # Overwrite any existing files
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -24,6 +25,7 @@ Function Log-Params
|
|||
Log "Store Path: $cdnStorePath"
|
||||
Log "Overwrite : $overwrite"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
Log "SourcePath: $jsSdkDir"
|
||||
Log "Log Path : $logDir"
|
||||
|
||||
|
@ -332,6 +334,11 @@ Function PublishFiles(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
Log " Using Cache Control: $cacheControlValue"
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ param (
|
|||
[string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login
|
||||
[string] $logPath = $null, # The location where logs should be written
|
||||
[switch] $minorOnly = $false, # Only set the active minor version (v2.x) and not the major version (v2)
|
||||
[switch] $testOnly = $false # Uploads to a "tst" test container on the storage account
|
||||
[switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account
|
||||
[switch] $cdn = $false # Uploads to a "cdn" container on the storage account
|
||||
)
|
||||
|
||||
$metaSdkVer = "aijssdkver"
|
||||
|
@ -27,6 +28,7 @@ Function Log-Params
|
|||
Log "Version : $activeVersion"
|
||||
Log "Store Path: $cdnStorePath"
|
||||
Log "Test Mode : $testOnly"
|
||||
Log "Cdn : $cdn"
|
||||
Log "Log Path : $logDir"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($global:sasToken) -eq $true) {
|
||||
|
@ -418,6 +420,11 @@ Function GetContainerContext(
|
|||
$storageContainer = "tst"
|
||||
}
|
||||
|
||||
if ($cdn -eq $true) {
|
||||
$blobPrefix = $storageContainer + "/" + $blobPrefix
|
||||
$storageContainer = "cdn"
|
||||
}
|
||||
|
||||
Log "Container : $storageContainer Prefix: $blobPrefix"
|
||||
|
||||
# Use the Users Storage Context credentials
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.0",
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/applicationinsights-core-js": "2.5.9",
|
||||
"@microsoft/applicationinsights-common": "2.5.9"
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"@microsoft/applicationinsights-common": "^2.5.9",
|
||||
"@microsoft/applicationinsights-core-js": "^2.5.9",
|
||||
"@microsoft/applicationinsights-shims": "^1.0.3",
|
||||
"@microsoft/dynamicproto-js": "^1.0.1"
|
||||
"@microsoft/dynamicproto-js": "^1.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native": "*",
|
||||
|
|
|
@ -47,6 +47,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims" : "1.0.3",
|
||||
"@microsoft/dynamicproto-js": "^1.0.0"
|
||||
"@microsoft/dynamicproto-js": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче