Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
299 changes: 158 additions & 141 deletions eng/pipelines/docindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,144 +44,161 @@ jobs:

- template: /eng/common/pipelines/templates/steps/set-default-branch.yml

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Move deprecated packages to legacy moniker
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Update Docs Onboarding for main branch
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-ReadmeFolderRoot 'api/overview/azure'
displayName: Generate Service Level Readme for main branch
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsToc.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-OutputLocation $(DocRepoLocation)/docs-ref-toc/reference-unified.yml
-ReadmeFolderRoot "api/overview/azure"
displayName: Generate ToC for main branch
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
displayName: Verify Required Docs Json Members

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(DefaultBranch)
BaseRepoOwner: $(DocRepoOwner)
CommitMsg: "Update docs CI configuration"
TargetRepoName: $(DocRepoName)
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)

# Prepare daily docs CI
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml
parameters:
DailyBranchVariableName: DailyDocsBranchName
- pwsh: |
$ErrorActionPreference = "Continue"
git checkout "origin/$(DailyDocsBranchName)" 2>&1 | Out-Null
$LASTEXITCODE = 0 # This ignores any error from git checkout
git status
displayName: Checkout daily branch if it exists
workingDirectory: $(DocRepoLocation)

- pwsh: |
$publicFeedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
Write-Host "##vso[task.setvariable variable=PackageSourceOverride]$publicFeedUrl"
displayName: Set package source variable
workingDirectory: $(DocRepoLocation)

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Move deprecated packages to legacy moniker
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
# Use the dotnet public daily package preview feed as the source for
# updated packages.
arguments: >
-DocRepoLocation $(DocRepoLocation)
-PackageSourceOverride $(PackageSourceOverride)
displayName: Update Docs Onboarding for Daily docs
- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-ReadmeFolderRoot 'api/overview/azure'
displayName: Generate Service Level Readme for Daily docs
- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsToc.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-OutputLocation $(DocRepoLocation)/docs-ref-toc/reference-unified.yml
-ReadmeFolderRoot "api/overview/azure"
-PackageSourceOverride $(PackageSourceOverride)
displayName: Generate ToC for Daily docs

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
displayName: Verify Required Docs Json Members

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(DailyDocsBranchName)
BaseRepoOwner: $(DocRepoOwner)
CommitMsg: "Update targeting packages based on release metadata. (Daily docs)"
TargetRepoName: $(DocRepoName)
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
PushArgs: -f

- task: AzureCLI@2
displayName: Queue Docs CI build
inputs:
azureSubscription: msdocs-apidrop-connection
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$accessToken = az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" --output tsv
$buildParamJson = (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)
eng/common/scripts/Queue-Pipeline.ps1 `
-Organization "apidrop" `
-Project "Content%20CI" `
-DefinitionId 397 `
-BuildParametersJson $buildParamJson `
-BearerToken $accessToken
# Updating main is the default reason to kick off manual builds of the docIndex run.
# Manual builds of docIndex are typically done to update Main when certain updates are
# made. These updates include new libraries and CSV updates in azure-sdk which, depending
# on the column(s) updated can cause anything from package deprecation to service level
# readme or ToC updates.
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), ne(variables['Skip.MainUpdate'], 'true')) }}:
- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
displayName: Verify Required Docs Json Members
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Move deprecated packages to legacy moniker

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Update Docs Onboarding for main branch
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-ReadmeFolderRoot 'api/overview/azure'
displayName: Generate Service Level Readme for main branch
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsToc.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-OutputLocation $(DocRepoLocation)/docs-ref-toc/reference-unified.yml
-ReadmeFolderRoot "api/overview/azure"
displayName: Generate ToC for main branch
condition: succeeded()

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(DefaultBranch)
BaseRepoOwner: $(DocRepoOwner)
CommitMsg: "Update docs CI configuration"
TargetRepoName: $(DocRepoName)
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)


# The scenario for running a Manual build is normally only for the main updates. The daily build
# should really only get kicked off for scheduled runs.
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.DailyUpdate'], 'true')) }}:
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml
parameters:
DailyBranchVariableName: DailyDocsBranchName
- pwsh: |
$ErrorActionPreference = "Continue"
git checkout "origin/$(DailyDocsBranchName)" 2>&1 | Out-Null
$LASTEXITCODE = 0 # This ignores any error from git checkout
git status
displayName: Checkout daily branch if it exists
workingDirectory: $(DocRepoLocation)

- pwsh: |
$publicFeedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
Write-Host "##vso[task.setvariable variable=PackageSourceOverride]$publicFeedUrl"
displayName: Set package source variable
workingDirectory: $(DocRepoLocation)

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
displayName: Verify Required Docs Json Members

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Move deprecated packages to legacy moniker
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
# Use the dotnet public daily package preview feed as the source for
# updated packages.
arguments: >
-DocRepoLocation $(DocRepoLocation)
-PackageSourceOverride $(PackageSourceOverride)
displayName: Update Docs Onboarding for Daily docs
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-ReadmeFolderRoot 'api/overview/azure'
displayName: Generate Service Level Readme for Daily docs
condition: succeeded()

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsToc.ps1
arguments: >-
-DocRepoLocation $(DocRepoLocation)
-OutputLocation $(DocRepoLocation)/docs-ref-toc/reference-unified.yml
-ReadmeFolderRoot "api/overview/azure"
-PackageSourceOverride $(PackageSourceOverride)
displayName: Generate ToC for Daily docs
condition: succeeded()

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(DailyDocsBranchName)
BaseRepoOwner: $(DocRepoOwner)
CommitMsg: "Update targeting packages based on release metadata. (Daily docs)"
TargetRepoName: $(DocRepoName)
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
PushArgs: -f

- task: AzureCLI@2
displayName: Queue Docs CI build
inputs:
azureSubscription: msdocs-apidrop-connection
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$accessToken = az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" --output tsv
$buildParamJson = (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)
eng/common/scripts/Queue-Pipeline.ps1 `
-Organization "apidrop" `
-Project "Content%20CI" `
-DefinitionId 397 `
-BuildParametersJson $buildParamJson `
-BearerToken $accessToken
condition: succeeded()
Loading