Sync eng/common directory with azure-sdk-tools for PR 1635 (#2353)
* Update common engineering system for docs onboarding * Add updates from review feedback * Space nit Co-authored-by: Daniel Jurek <djurek@microsoft.com>
This commit is contained in:
parent
8257ce32da
commit
97ba448859
36
eng/common/scripts/Update-DocsMsPackages.ps1
Normal file
36
eng/common/scripts/Update-DocsMsPackages.ps1
Normal file
@ -0,0 +1,36 @@
|
||||
# This script is intended to update docs.ms CI configuration (currently supports Java, Python, C#, JS) in nightly build
|
||||
# For details on calling, check `docindex.yml`.
|
||||
|
||||
# In this script, we will do the following business logic.
|
||||
# 1. Filter out the packages from release csv file by `New=true`, `Hide!=true`
|
||||
# 2. Compare current package list with the csv packages, and keep them in sync. Leave other packages as they are.
|
||||
# 3. Update the tarage packages back to CI config files.
|
||||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DocRepoLocation # the location of the cloned doc repo
|
||||
)
|
||||
|
||||
. (Join-Path $PSScriptRoot common.ps1)
|
||||
|
||||
function GetDocsMetadata() {
|
||||
(Get-CSVMetadata).Where({ $_.New -eq 'true' -and $_.Hide -ne 'true' })
|
||||
}
|
||||
|
||||
if ($UpdateDocsMsPackagesFn -and (Test-Path "Function:$UpdateDocsMsPackagesFn")) {
|
||||
|
||||
try {
|
||||
$docsMetadata = GetDocsMetadata
|
||||
&$UpdateDocsMsPackagesFn -DocsRepoLocation $DocRepoLocation -DocsMetadata $docsMetadata
|
||||
} catch {
|
||||
LogError "Exception while updating docs.ms packages"
|
||||
LogError $_
|
||||
LogError $_.ScriptStackTrace
|
||||
exit 1
|
||||
}
|
||||
|
||||
} else {
|
||||
LogError "The function for '$UpdateFn' was not found.`
|
||||
Make sure it is present in eng/scripts/Language-Settings.ps1 and referenced in eng/common/scripts/common.ps1.`
|
||||
See https://github.com/Azure/azure-sdk-tools/blob/master/doc/common/common_engsys.md#code-structure"
|
||||
exit 1
|
||||
}
|
||||
@ -39,6 +39,6 @@ if (!(Get-Variable -Name "LanguageDisplayName" -ValueOnly -ErrorAction "Ignore")
|
||||
$GetPackageInfoFromRepoFn = "Get-${Language}-PackageInfoFromRepo"
|
||||
$GetPackageInfoFromPackageFileFn = "Get-${Language}-PackageInfoFromPackageFile"
|
||||
$PublishGithubIODocsFn = "Publish-${Language}-GithubIODocs"
|
||||
$UpdateDocCIFn = "Update-${Language}-CIConfig"
|
||||
$UpdateDocsMsPackagesFn = "Update-${Language}-DocsMsPackages"
|
||||
$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex"
|
||||
$FindArtifactForApiReviewFn = "Find-${Language}-Artifacts-For-Apireview"
|
||||
$FindArtifactForApiReviewFn = "Find-${Language}-Artifacts-For-Apireview"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user