2021-05-21 00:20:54 +03:00
|
|
|
trigger: none
|
2022-06-03 00:32:25 +03:00
|
|
|
variables:
|
|
|
|
- template: /eng/pipelines/templates/variables/globals.yml
|
2021-05-21 00:20:54 +03:00
|
|
|
jobs:
|
|
|
|
- template: /eng/common/pipelines/templates/jobs/docindex.yml
|
2021-05-27 18:57:46 +03:00
|
|
|
|
|
|
|
- job: UpdateDocsMsBuildConfig
|
2021-11-08 22:10:26 +03:00
|
|
|
timeoutInMinutes: 90
|
2021-05-27 18:57:46 +03:00
|
|
|
pool:
|
2021-06-23 21:54:58 +03:00
|
|
|
vmImage: ubuntu-20.04
|
2021-05-27 18:57:46 +03:00
|
|
|
variables:
|
|
|
|
DocRepoLocation: $(Pipeline.Workspace)/docs
|
|
|
|
DocRepoOwner: MicrosoftDocs
|
|
|
|
DocRepoName: azure-docs-sdk-node
|
2021-11-05 08:13:56 +03:00
|
|
|
DocValidationImageId: azuresdkimages.azurecr.io/jsrefautocr:latest
|
2021-05-27 18:57:46 +03:00
|
|
|
steps:
|
|
|
|
# Sync docs repo (this can be sparse)
|
|
|
|
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
|
|
|
|
parameters:
|
|
|
|
SkipDefaultCheckout: true
|
|
|
|
Paths:
|
2022-03-02 20:00:58 +03:00
|
|
|
- ci-configs/
|
2021-07-01 21:41:25 +03:00
|
|
|
- metadata/
|
2022-03-01 18:46:36 +03:00
|
|
|
- docs-ref-mapping/
|
2022-07-19 00:28:14 +03:00
|
|
|
- docs-ref-services/
|
2021-05-27 18:57:46 +03:00
|
|
|
Repositories:
|
|
|
|
- Name: $(DocRepoOwner)/$(DocRepoName)
|
|
|
|
WorkingDirectory: $(DocRepoLocation)
|
2021-11-08 22:10:26 +03:00
|
|
|
# Pull and build the docker image.
|
2021-11-05 08:13:56 +03:00
|
|
|
- template: /eng/common/pipelines/templates/steps/docker-pull-image.yml
|
|
|
|
parameters:
|
|
|
|
ContainerRegistryClientId: $(azuresdkimages-cr-clientid)
|
|
|
|
ContainerRegistryClientSecret: $(azuresdkimages-cr-clientsecret)
|
2021-11-08 22:10:26 +03:00
|
|
|
ImageId: "$(DocValidationImageId)"
|
2021-05-27 18:57:46 +03:00
|
|
|
|
|
|
|
# Call update docs ci script to onboard packages
|
|
|
|
- task: Powershell@2
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
|
2021-11-05 08:13:56 +03:00
|
|
|
arguments: -DocRepoLocation $(DocRepoLocation) -ImageId '$(DocValidationImageId)'
|
2021-05-27 18:57:46 +03:00
|
|
|
displayName: Update Docs Onboarding
|
2021-11-05 08:13:56 +03:00
|
|
|
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
|
2021-11-08 22:10:26 +03:00
|
|
|
|
2022-07-20 20:23:10 +03:00
|
|
|
- task: Powershell@2
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
|
|
|
|
arguments: >-
|
|
|
|
-DocRepoLocation $(DocRepoLocation)
|
|
|
|
-TenantId '$(opensource-aad-tenant-id)'
|
|
|
|
-ClientId '$(opensource-aad-app-id)'
|
|
|
|
-ClientSecret '$(opensource-aad-secret)'
|
|
|
|
|
|
|
|
displayName: Generate Service Level Readme
|
|
|
|
|
2022-03-03 20:18:30 +03:00
|
|
|
- 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
|
2022-03-23 20:47:44 +03:00
|
|
|
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
|
2022-03-03 20:18:30 +03:00
|
|
|
|
2021-05-27 18:57:46 +03:00
|
|
|
# Push changes to docs repo
|
|
|
|
- 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)
|
2021-07-01 21:41:25 +03:00
|
|
|
|
|
|
|
# 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)
|
|
|
|
- task: Powershell@2
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
|
2021-12-10 06:19:31 +03:00
|
|
|
arguments: -DocRepoLocation $(DocRepoLocation)
|
2021-07-01 21:41:25 +03:00
|
|
|
displayName: Update Docs Onboarding for Daily branch
|
2021-11-05 08:13:56 +03:00
|
|
|
|
2022-07-19 00:28:14 +03:00
|
|
|
- task: Powershell@2
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
|
|
|
|
arguments: >-
|
|
|
|
-DocRepoLocation $(DocRepoLocation)
|
|
|
|
-TenantId '$(opensource-aad-tenant-id)'
|
|
|
|
-ClientId '$(opensource-aad-app-id)'
|
|
|
|
-ClientSecret '$(opensource-aad-secret)'
|
|
|
|
displayName: Generate Service Level Readme
|
|
|
|
|
2022-03-01 18:46:36 +03:00
|
|
|
- task: Powershell@2
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Update-DocsMsToc.ps1
|
|
|
|
arguments: >-
|
|
|
|
-DocRepoLocation $(DocRepoLocation)
|
|
|
|
-OutputLocation $(DocRepoLocation)/docs-ref-mapping/reference-unified.yml
|
2022-03-03 20:18:30 +03:00
|
|
|
displayName: Generate ToC for Daily branch
|
2022-03-01 18:46:36 +03:00
|
|
|
|
2021-07-01 21:41:25 +03:00
|
|
|
- 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
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Queue Docs CI build
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
filePath: eng/common/scripts/Queue-Pipeline.ps1
|
|
|
|
arguments: >
|
|
|
|
-Organization "apidrop"
|
|
|
|
-Project "Content%20CI"
|
|
|
|
-DefinitionId 3452
|
|
|
|
-Base64EncodedAuthToken "$(azuresdk-apidrop-devops-queue-build-pat)"
|
|
|
|
-BuildParametersJson '{"params":"{ \"target_repo\": { \"url\": \"https://github.com/MicrosoftDocs/azure-docs-sdk-node\", \"branch\": \"$(DailyDocsBranchName)\", \"folder\": \"./\" }, \"source_repos\": [] }"}'
|