Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 2086
  • Loading branch information
sima-zhu authored and azure-sdk committed Oct 7, 2021
1 parent 8eeccb2 commit e12a4f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ parameters:
type: object
default:
- '**'
- name: PipelineRequestBy
type: string
default: $(Release.RequestedFor)

steps:
- template: /eng/common/pipelines/templates/steps/enable-long-path-support.yml
Expand Down Expand Up @@ -82,6 +85,7 @@ steps:
-DocRepoLocation "$(DocRepoLocation)" `
-Language '${{parameters.Language}}' `
-RepoId '${{ parameters.RepoId }}'
-DocAuthor '${{ parameters.PipelineRequestBy }}'
displayName: Apply Documentation Updates

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
Expand Down
10 changes: 6 additions & 4 deletions eng/common/scripts/Update-DocsMsMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ Location of the root of the docs.microsoft.com reference doc location. Further
path information is provided by $GetDocsMsMetadataForPackageFn
.PARAMETER Language
Programming language to supply to metadata
Programming language to supply to metadata. It can default to the variable of 'Language' in Language-Setting.ps1.
.PARAMETER RepoId
GitHub repository ID of the SDK. Typically of the form: 'Azure/azure-sdk-for-js'
.PARAMETER DocAuthor
The one triggered the release pipeline will be the doc.ms author
#>

param(
Expand All @@ -37,7 +39,7 @@ param(
[Parameter(Mandatory = $true)]
[string]$DocRepoLocation,

[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[string]$Language,

[Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -82,8 +84,8 @@ function GetAdjustedReadmeContent($ReadmeContent, $PackageInfo, $PackageMetadata
---
title: $foundTitle
keywords: Azure, $Language, SDK, API, $($PackageInfo.Name), $service
author: maggiepint
ms.author: magpint
author: $DocAuthor
ms.author: $DocAuthor
ms.date: $date
ms.topic: reference
ms.prod: azure
Expand Down
6 changes: 4 additions & 2 deletions eng/common/scripts/update-docs-metadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ param (
[Parameter(Mandatory = $true)]
$Language, # EG: js, java, dotnet. Used in language for the embedded readme.
[Parameter(Mandatory = $true)]
$Configs # The configuration elements informing important locations within the cloned doc repo
$Configs, # The configuration elements informing important locations within the cloned doc repo
[Parameter(Mandatory = $true)]
$DocAuther # The one triggered the release pipeline will be the doc.ms author
)

. (Join-Path $PSScriptRoot common.ps1)
Expand Down Expand Up @@ -71,7 +73,7 @@ function GetAdjustedReadmeContent($pkgInfo){
$ReplacementPattern = "`${1}$($pkgInfo.Tag)"
$fileContent = $fileContent -replace $releaseReplaceRegex, $ReplacementPattern

$header = "---`ntitle: $foundTitle`nkeywords: Azure, $Language, SDK, API, $($pkgInfo.PackageId), $service`nauthor: maggiepint`nms.author: magpint`nms.date: $date`nms.topic: reference`nms.prod: azure`nms.technology: azure`nms.devlang: $Language`nms.service: $service`n---`n"
$header = "---`ntitle: $foundTitle`nkeywords: Azure, $Language, SDK, API, $($pkgInfo.PackageId), $service`nauthor: $`nms.author: $DocAuthor`nms.date: $date`nms.topic: reference`nms.prod: azure`nms.technology: azure`nms.devlang: $Language`nms.service: $service`n---`n"

if ($fileContent) {
return "$header`n$fileContent"
Expand Down

0 comments on commit e12a4f0

Please sign in to comment.