From 25c2ad6d941d28e4c78054300ef0c026126b6698 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 6 Sep 2023 15:35:28 +0000 Subject: [PATCH] docindex changes --- eng/pipelines/docindex.yml | 172 +++++++++++++++++++------------------ 1 file changed, 90 insertions(+), 82 deletions(-) diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 09da48c478689..d775f494e3232 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -38,12 +38,12 @@ jobs: Repositories: - Name: $(DocRepoOwner)/$(DocRepoName) WorkingDirectory: $(DocRepoLocation) - Commitish: djurek/test-legacy-migration + # Install the tool for toc step to use - task: NuGetToolInstaller@1 inputs: versionSpec: 6.3.1 - # Call update docs ci script to onboard packages + - template: /eng/common/pipelines/templates/steps/set-default-branch.yml - task: Powershell@2 @@ -94,7 +94,7 @@ jobs: - template: /eng/common/pipelines/templates/steps/git-push-changes.yml parameters: - BaseRepoBranch: djurek/test-legacy-migration + BaseRepoBranch: $(DefaultBranch) BaseRepoOwner: $(DocRepoOwner) CommitMsg: "Update docs CI configuration" TargetRepoName: $(DocRepoName) @@ -102,82 +102,90 @@ jobs: 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-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) - # -TenantId '$(opensource-aad-tenant-id)' - # -ClientId '$(opensource-aad-app-id)' - # -ClientSecret '$(opensource-aad-secret)' - # -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: PowerShell@2 - # displayName: Queue Docs CI build - # inputs: - # pwsh: true - # filePath: eng/common/scripts/Queue-Pipeline.ps1 - # arguments: > - # -Organization "apidrop" - # -Project "Content%20CI" - # -DefinitionId 397 - # -AuthToken "$(azuresdk-apidrop-devops-queue-build-pat)" - # -BuildParametersJson (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json) + - 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) + -TenantId '$(opensource-aad-tenant-id)' + -ClientId '$(opensource-aad-app-id)' + -ClientSecret '$(opensource-aad-secret)' + -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: PowerShell@2 + displayName: Queue Docs CI build + inputs: + pwsh: true + filePath: eng/common/scripts/Queue-Pipeline.ps1 + arguments: > + -Organization "apidrop" + -Project "Content%20CI" + -DefinitionId 397 + -AuthToken "$(azuresdk-apidrop-devops-queue-build-pat)" + -BuildParametersJson (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)