Skip to content

Commit

Permalink
Update docIndex to kick off the docs SDK CI run for main (#47434)
Browse files Browse the repository at this point in the history
* Update docIndex to kick off the docs SDK CI run for main

* Add a parameter to determine whether or not the SDK CI run for main should be kicked off as part of a manual run

* Fix the condition to check true

* The condition was indented too far...go me

* Update eng/pipelines/docindex.yml

Co-authored-by: Ben Broderick Phillips <[email protected]>

* Update eng/pipelines/docindex.yml

Co-authored-by: Daniel Jurek <[email protected]>

---------

Co-authored-by: Ben Broderick Phillips <[email protected]>
Co-authored-by: Daniel Jurek <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent d366345 commit 4c6ef77
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions eng/dailydocsconfig.json → eng/docsSDKCIConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"TFM": "net471",
"target_repo": {
"url": "https://github.com/Azure/azure-docs-sdk-dotnet",
"branch": "%%DailyDocsBranchName%%",
"branch": "%%DocsBranchName%%",
"folder": "xml"
},
"source_repo": {
"url": "https://github.com/Azure/azure-docs-sdk-dotnet",
"branch": "%%DailyDocsBranchName%%",
"branch": "%%DocsBranchName%%",
"csvPath": "bundlepackages"
},
"import_content": true
Expand Down
25 changes: 24 additions & 1 deletion eng/pipelines/docindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ parameters:
type: boolean
default: true

- name: StartMainSDKCIRun
displayName: |
Kick off the main SDK CI docs run when manually running the pipeline
type: boolean
default: false

- name: ForceDailyUpdate
displayName: |
Force the daily branch update (includes starting daily branch run).
Expand Down Expand Up @@ -114,6 +120,23 @@ jobs:
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)

- task: AzureCLI@2
displayName: Queue Docs CI build for main branch
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(${{ parameters.StartMainSDKCIRun }}, true)))
inputs:
azureSubscription: msdocs-apidrop-connection
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
# Resource here is the Devops API scope
$accessToken = az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" --output tsv
$buildParamJson = (@{ params = (Get-Content ./eng/docsSDKCIConfig.json -Raw) -replace '%%DocsBranchName%%', "main" } | ConvertTo-Json)
eng/common/scripts/Queue-Pipeline.ps1 `
-Organization "apidrop" `
-Project "Content%20CI" `
-DefinitionId 397 `
-BuildParametersJson $buildParamJson `
-BearerToken $accessToken
# 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.
Expand Down Expand Up @@ -200,7 +223,7 @@ jobs:
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)
$buildParamJson = (@{ params = (Get-Content ./eng/docsSDKCIConfig.json -Raw) -replace '%%DocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)
eng/common/scripts/Queue-Pipeline.ps1 `
-Organization "apidrop" `
-Project "Content%20CI" `
Expand Down

0 comments on commit 4c6ef77

Please sign in to comment.