Skip to content

Commit 07be039

Browse files
authored
Update docIndex for manual runs (#38694)
1 parent 3750f4d commit 07be039

1 file changed

Lines changed: 149 additions & 129 deletions

File tree

eng/pipelines/docindex.yml

Lines changed: 149 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
trigger: none
2+
3+
parameters:
4+
- name: UpdateMain
5+
displayName: |
6+
Update main branch.
7+
type: boolean
8+
default: true
9+
10+
- name: ForceDailyUpdate
11+
displayName: |
12+
Force the daily branch update (includes starting daily branch run).
13+
type: boolean
14+
default: false
15+
216
variables:
317
- template: /eng/pipelines/templates/variables/globals.yml
418
jobs:
@@ -38,136 +52,142 @@ jobs:
3852

3953
- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml
4054

41-
- task: Powershell@2
42-
inputs:
43-
pwsh: true
44-
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
45-
arguments: -DocRepoLocation $(DocRepoLocation)
46-
displayName: Move deprecated packages to legacy moniker
47-
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
48-
49-
- task: Powershell@2
50-
inputs:
51-
pwsh: true
52-
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
53-
arguments: -DocRepoLocation $(DocRepoLocation)
54-
displayName: Update Docs Onboarding for main branch
55-
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
56-
57-
- task: Powershell@2
58-
inputs:
59-
pwsh: true
60-
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
61-
arguments: -DocRepoLocation $(DocRepoLocation)
62-
displayName: Generate Service Level Readme for main branch
63-
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
64-
65-
- task: Powershell@2
66-
inputs:
67-
pwsh: true
68-
filePath: eng/common/scripts/Update-DocsMsToc.ps1
69-
arguments: >-
70-
-DocRepoLocation $(DocRepoLocation)
71-
-OutputLocation $(DocRepoLocation)/docs-ref-mapping/reference-unified.yml
72-
displayName: Generate ToC for main branch
73-
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
74-
75-
- task: Powershell@2
76-
inputs:
77-
pwsh: true
78-
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
79-
arguments: >-
80-
-DocRepoLocation $(DocRepoLocation)
81-
displayName: Verify Required Docs Json Members
82-
83-
# Push changes to docs repo
8455
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
8556
parameters:
8657
WorkingDirectory: $(DocRepoLocation)
8758

88-
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
89-
parameters:
90-
BaseRepoBranch: $(DefaultBranch)
91-
BaseRepoOwner: $(DocRepoOwner)
92-
CommitMsg: "Update docs CI configuration Build: $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
93-
TargetRepoName: $(DocRepoName)
94-
TargetRepoOwner: $(DocRepoOwner)
95-
WorkingDirectory: $(DocRepoLocation)
96-
97-
# Prepare daily docs CI
98-
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml
99-
parameters:
100-
DailyBranchVariableName: DailyDocsBranchName
101-
- pwsh: |
102-
$ErrorActionPreference = "Continue"
103-
git checkout "origin/$(DailyDocsBranchName)" 2>&1 | Out-Null
104-
$LASTEXITCODE = 0 # This ignores any error from git checkout
105-
git status
106-
displayName: Checkout daily branch if it exists
107-
workingDirectory: $(DocRepoLocation)
108-
109-
- task: Powershell@2
110-
inputs:
111-
pwsh: true
112-
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
113-
arguments: -DocRepoLocation $(DocRepoLocation)
114-
displayName: Move deprecated packages to legacy moniker
115-
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
116-
117-
- task: Powershell@2
118-
inputs:
119-
pwsh: true
120-
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
121-
arguments: >-
122-
-DocRepoLocation $(DocRepoLocation)
123-
-PackageSourceOverride "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
124-
displayName: Update Docs Onboarding for Daily docs
125-
- task: Powershell@2
126-
inputs:
127-
pwsh: true
128-
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
129-
arguments: -DocRepoLocation $(DocRepoLocation)
130-
displayName: Generate Service Level Readme for Daily docs
131-
- task: Powershell@2
132-
inputs:
133-
pwsh: true
134-
filePath: eng/common/scripts/Update-DocsMsToc.ps1
135-
arguments: >-
136-
-DocRepoLocation $(DocRepoLocation)
137-
-OutputLocation $(DocRepoLocation)/docs-ref-mapping/reference-unified.yml
138-
displayName: Generate ToC for Daily Docs
139-
140-
- task: Powershell@2
141-
inputs:
142-
pwsh: true
143-
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
144-
arguments: >-
145-
-DocRepoLocation $(DocRepoLocation)
146-
displayName: Verify Required Docs Json Members
147-
148-
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
149-
parameters:
150-
BaseRepoBranch: $(DailyDocsBranchName)
151-
BaseRepoOwner: $(DocRepoOwner)
152-
CommitMsg: "Update targeting packages based on release metadata. (Daily docs)"
153-
TargetRepoName: $(DocRepoName)
154-
TargetRepoOwner: $(DocRepoOwner)
155-
WorkingDirectory: $(DocRepoLocation)
156-
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
157-
PushArgs: -f
158-
159-
- task: AzureCLI@2
160-
displayName: Queue Docs CI build
161-
inputs:
162-
azureSubscription: msdocs-apidrop-connection
163-
scriptType: pscore
164-
scriptLocation: inlineScript
165-
inlineScript: |
166-
$accessToken = az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" --output tsv
167-
$buildParamJson = (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)
168-
eng/common/scripts/Queue-Pipeline.ps1 `
169-
-Organization "apidrop" `
170-
-Project "Content%20CI" `
171-
-DefinitionId 5533 `
172-
-BuildParametersJson $buildParamJson `
173-
-BearerToken $accessToken
59+
# Updating main is the default reason to kick off manual builds of the docIndex run.
60+
# Manual builds of docIndex are typically done to update Main when certain updates are
61+
# made. These updates include new libraries and CSV updates in azure-sdk which, depending
62+
# on the column(s) updated can cause anything from package deprecation to service level
63+
# readme or ToC updates.
64+
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), parameters.UpdateMain) }}:
65+
- task: Powershell@2
66+
inputs:
67+
pwsh: true
68+
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
69+
arguments: >-
70+
-DocRepoLocation $(DocRepoLocation)
71+
displayName: Verify Required Docs Json Members
72+
73+
- task: Powershell@2
74+
inputs:
75+
pwsh: true
76+
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
77+
arguments: -DocRepoLocation $(DocRepoLocation)
78+
displayName: Move deprecated packages to legacy moniker
79+
80+
- task: Powershell@2
81+
inputs:
82+
pwsh: true
83+
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
84+
arguments: -DocRepoLocation $(DocRepoLocation)
85+
displayName: Update Docs Onboarding for main branch
86+
87+
- task: Powershell@2
88+
inputs:
89+
pwsh: true
90+
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
91+
arguments: -DocRepoLocation $(DocRepoLocation)
92+
displayName: Generate Service Level Readme for main branch
93+
94+
- task: Powershell@2
95+
inputs:
96+
pwsh: true
97+
filePath: eng/common/scripts/Update-DocsMsToc.ps1
98+
arguments: >-
99+
-DocRepoLocation $(DocRepoLocation)
100+
-OutputLocation $(DocRepoLocation)/docs-ref-mapping/reference-unified.yml
101+
displayName: Generate ToC for main branch
102+
103+
# Push changes to docs repo
104+
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
105+
parameters:
106+
BaseRepoBranch: $(DefaultBranch)
107+
BaseRepoOwner: $(DocRepoOwner)
108+
CommitMsg: "Update docs CI configuration Build: $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
109+
TargetRepoName: $(DocRepoName)
110+
TargetRepoOwner: $(DocRepoOwner)
111+
WorkingDirectory: $(DocRepoLocation)
112+
113+
# The scenario for running a Manual build is normally only for the main updates. The daily build
114+
# should really only get kicked off for scheduled runs.
115+
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), parameters.ForceDailyUpdate) }}:
116+
# Prepare daily docs CI
117+
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml
118+
parameters:
119+
DailyBranchVariableName: DailyDocsBranchName
120+
- pwsh: |
121+
$ErrorActionPreference = "Continue"
122+
git checkout "origin/$(DailyDocsBranchName)" 2>&1 | Out-Null
123+
$LASTEXITCODE = 0 # This ignores any error from git checkout
124+
git status
125+
displayName: Checkout daily branch if it exists
126+
workingDirectory: $(DocRepoLocation)
127+
128+
- task: Powershell@2
129+
inputs:
130+
pwsh: true
131+
filePath: eng/common/scripts/Verify-RequiredDocsJsonMembers.ps1
132+
arguments: >-
133+
-DocRepoLocation $(DocRepoLocation)
134+
displayName: Verify Required Docs Json Members
135+
136+
- task: Powershell@2
137+
inputs:
138+
pwsh: true
139+
filePath: eng/common/scripts/Update-DocsMsPackageMonikers.ps1
140+
arguments: -DocRepoLocation $(DocRepoLocation)
141+
displayName: Move deprecated packages to legacy moniker
142+
143+
- task: Powershell@2
144+
inputs:
145+
pwsh: true
146+
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
147+
arguments: >-
148+
-DocRepoLocation $(DocRepoLocation)
149+
-PackageSourceOverride "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
150+
displayName: Update Docs Onboarding for Daily docs
151+
152+
- task: Powershell@2
153+
inputs:
154+
pwsh: true
155+
filePath: eng/common/scripts/Service-Level-Readme-Automation.ps1
156+
arguments: -DocRepoLocation $(DocRepoLocation)
157+
displayName: Generate Service Level Readme for Daily docs
158+
159+
- task: Powershell@2
160+
inputs:
161+
pwsh: true
162+
filePath: eng/common/scripts/Update-DocsMsToc.ps1
163+
arguments: >-
164+
-DocRepoLocation $(DocRepoLocation)
165+
-OutputLocation $(DocRepoLocation)/docs-ref-mapping/reference-unified.yml
166+
displayName: Generate ToC for Daily Docs
167+
168+
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
169+
parameters:
170+
BaseRepoBranch: $(DailyDocsBranchName)
171+
BaseRepoOwner: $(DocRepoOwner)
172+
CommitMsg: "Update targeting packages based on release metadata. (Daily docs)"
173+
TargetRepoName: $(DocRepoName)
174+
TargetRepoOwner: $(DocRepoOwner)
175+
WorkingDirectory: $(DocRepoLocation)
176+
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
177+
PushArgs: -f
178+
179+
- task: AzureCLI@2
180+
displayName: Queue Docs CI build
181+
inputs:
182+
azureSubscription: msdocs-apidrop-connection
183+
scriptType: pscore
184+
scriptLocation: inlineScript
185+
inlineScript: |
186+
$accessToken = az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" --output tsv
187+
$buildParamJson = (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)
188+
eng/common/scripts/Queue-Pipeline.ps1 `
189+
-Organization "apidrop" `
190+
-Project "Content%20CI" `
191+
-DefinitionId 5533 `
192+
-BuildParametersJson $buildParamJson `
193+
-BearerToken $accessToken

0 commit comments

Comments
 (0)