File: docindex.yml

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (151 lines) | stat: -rw-r--r-- 6,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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:
      # Docs CI uses Python 3.9.13
      - task: UsePythonVersion@0
        displayName: 'Use Python 3.9.13'
        inputs:
          versionSpec: '3.9.13'

      # Docs CI upgrades pip, wheel, and setuptools
      - pwsh: pip install --upgrade pip wheel setuptools
        displayName: Update python tools for package verification

      # Pull and build the docker image.
      - template: /eng/common/pipelines/templates/steps/docker-pull-image.yml
        parameters:
          ContainerRegistryClientId: $(azuresdkimages-cr-clientid)
          ContainerRegistryClientSecret: $(azuresdkimages-cr-clientsecret)
          ImageId: "$(DocValidationImageId)"
      # Sync docs repo onboarding files/folders
      - 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)

      # Call update docs ci script to onboard packages
      - 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)
            -TenantId '$(opensource-aad-tenant-id)'
            -ClientId '$(opensource-aad-app-id)'
            -ClientSecret '$(opensource-aad-secret)'
        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')))

      # 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)

      # 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
          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)
            -TenantId '$(opensource-aad-tenant-id)'
            -ClientId '$(opensource-aad-app-id)'
            -ClientSecret '$(opensource-aad-secret)'
        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

      - 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 3453
            -Base64EncodedAuthToken "$(azuresdk-apidrop-devops-queue-build-pat)"
            -BuildParametersJson (@{ params = (Get-Content ./eng/dailydocsconfig.json -Raw) -replace '%%DailyDocsBranchName%%', "$(DailyDocsBranchName)" } | ConvertTo-Json)