|
trigger: none |
|
variables: |
|
- template: /eng/pipelines/templates/variables/globals.yml |
|
jobs: |
|
- template: /eng/common/pipelines/templates/jobs/docindex.yml |
|
|
|
- job: UpdateDocsMsBuildConfig |
|
pool: |
|
name: azsdk-pool-mms-ubuntu-2004-general |
|
vmImage: Ubuntu20.04 |
|
variables: |
|
DocRepoLocation: $(Pipeline.Workspace)/docs |
|
DocRepoOwner: MicrosoftDocs |
|
DocRepoName: azure-docs-sdk-python |
|
DocValidationImageId: azuresdkimages.azurecr.io/pyrefautocr:latest |
|
steps: |
|
|
|
- task: UsePythonVersion@0 |
|
displayName: 'Use Python 3.9.13' |
|
inputs: |
|
versionSpec: '3.9.13' |
|
|
|
|
|
- pwsh: python -m pip install --upgrade pip wheel setuptools |
|
displayName: Update python tools for package verification |
|
|
|
|
|
- template: /eng/common/pipelines/templates/steps/docker-pull-image.yml |
|
parameters: |
|
ImageId: "$(DocValidationImageId)" |
|
|
|
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml |
|
parameters: |
|
SkipCheckoutNone: true |
|
Paths: |
|
- ci-configs/ |
|
- metadata/ |
|
- docs-ref-mapping/ |
|
- docs-ref-services/ |
|
Repositories: |
|
- Name: $(DocRepoOwner)/$(DocRepoName) |
|
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 |
|
arguments: -DocRepoLocation $(DocRepoLocation) -ImageId '$(DocValidationImageId)' |
|
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) |
|
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-mapping/reference-unified.yml |
|
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/set-default-branch.yml |
|
parameters: |
|
WorkingDirectory: $(DocRepoLocation) |
|
|
|
- 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) |
|
|
|
|
|
- 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) |
|
|
|
- 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) |
|
-PackageSourceOverride "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" |
|
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) |
|
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-mapping/reference-unified.yml |
|
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 5533 ` |
|
-BuildParametersJson $buildParamJson ` |
|
-BearerToken $accessToken |
|
|