Skip to content

Commit 64f06ce

Browse files
Sync eng/common directory with azure-sdk-tools for PR 1635 (Azure#18969)
* Update common engineering system for docs onboarding * Add updates from review feedback * Space nit Co-authored-by: Daniel Jurek <djurek@microsoft.com>
1 parent 8988814 commit 64f06ce

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This script is intended to update docs.ms CI configuration (currently supports Java, Python, C#, JS) in nightly build
2+
# For details on calling, check `docindex.yml`.
3+
4+
# In this script, we will do the following business logic.
5+
# 1. Filter out the packages from release csv file by `New=true`, `Hide!=true`
6+
# 2. Compare current package list with the csv packages, and keep them in sync. Leave other packages as they are.
7+
# 3. Update the tarage packages back to CI config files.
8+
param (
9+
[Parameter(Mandatory = $true)]
10+
$DocRepoLocation # the location of the cloned doc repo
11+
)
12+
13+
. (Join-Path $PSScriptRoot common.ps1)
14+
15+
function GetDocsMetadata() {
16+
(Get-CSVMetadata).Where({ $_.New -eq 'true' -and $_.Hide -ne 'true' })
17+
}
18+
19+
if ($UpdateDocsMsPackagesFn -and (Test-Path "Function:$UpdateDocsMsPackagesFn")) {
20+
21+
try {
22+
$docsMetadata = GetDocsMetadata
23+
&$UpdateDocsMsPackagesFn -DocsRepoLocation $DocRepoLocation -DocsMetadata $docsMetadata
24+
} catch {
25+
LogError "Exception while updating docs.ms packages"
26+
LogError $_
27+
LogError $_.ScriptStackTrace
28+
exit 1
29+
}
30+
31+
} else {
32+
LogError "The function for '$UpdateFn' was not found.`
33+
Make sure it is present in eng/scripts/Language-Settings.ps1 and referenced in eng/common/scripts/common.ps1.`
34+
See https://github.com/Azure/azure-sdk-tools/blob/master/doc/common/common_engsys.md#code-structure"
35+
exit 1
36+
}

eng/common/scripts/common.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ if (!(Get-Variable -Name "LanguageDisplayName" -ValueOnly -ErrorAction "Ignore")
3939
$GetPackageInfoFromRepoFn = "Get-${Language}-PackageInfoFromRepo"
4040
$GetPackageInfoFromPackageFileFn = "Get-${Language}-PackageInfoFromPackageFile"
4141
$PublishGithubIODocsFn = "Publish-${Language}-GithubIODocs"
42-
$UpdateDocCIFn = "Update-${Language}-CIConfig"
42+
$UpdateDocsMsPackagesFn = "Update-${Language}-DocsMsPackages"
4343
$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex"
44-
$FindArtifactForApiReviewFn = "Find-${Language}-Artifacts-For-Apireview"
44+
$FindArtifactForApiReviewFn = "Find-${Language}-Artifacts-For-Apireview"

0 commit comments

Comments
 (0)