...

Text file src/github.com/Azure/azure-sdk-for-go/eng/common/pipelines/templates/steps/docs-metadata-release.yml

Documentation: github.com/Azure/azure-sdk-for-go/eng/common/pipelines/templates/steps

     1# intended to be used as part of a release process
     2parameters:
     3  - name: ArtifactLocation
     4    type: string
     5    default: 'not-specified'
     6  - name: PackageRepository
     7    type: string
     8    default: 'not-specified'
     9  - name: ReleaseSha
    10    type: string
    11    default: 'not-specified'
    12  - name: RepoId
    13    type: string
    14    default: $(Build.Repository.Name)
    15  - name: WorkingDirectory
    16    type: string
    17    default: ''
    18  - name: ScriptDirectory
    19    type: string
    20    default: eng/common/scripts
    21  - name: TargetDocRepoName
    22    type: string
    23    default: ''
    24  - name: TargetDocRepoOwner
    25    type: string
    26    default: ''
    27  - name: PRBranchName
    28    type: string
    29    default: 'main-rdme'
    30  - name: PRLabels
    31    type: string
    32    default: 'auto-merge'
    33  - name: ArtifactName
    34    type: string
    35    default: ''
    36  - name: Language
    37    type: string
    38    default: ''
    39  - name: DocRepoDestinationPath
    40    type: string
    41    default: '' #usually docs-ref-services/
    42  - name: CIConfigs
    43    type: string
    44    default: '[]'
    45  - name: GHReviewersVariable
    46    type: string
    47    default: ''
    48  - name: GHTeamReviewersVariable
    49    type: string
    50    default: ''  # externally set, as eng-common does not have the identity-resolver. Run as pre-step
    51  - name: OnboardingBranch
    52    type: string
    53    default: ''
    54  - name: CloseAfterOpenForTesting
    55    type: boolean
    56    default: false
    57  - name: SkipPackageJson
    58    type: object
    59    default: false
    60  - name: SparseCheckoutPaths
    61    type: object
    62    default: null
    63
    64steps:
    65- pwsh: |
    66    if ($IsWindows) {
    67      REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /f /v LongPathsEnabled /t REG_DWORD /d 1
    68      git config --system core.longpaths true
    69    }
    70    else {
    71      Write-Host "This script is not executing on Windows, skipping registry modification."
    72    }
    73  displayName: Enable Long Paths if Necessary
    74
    75- ${{ if not(parameters.SparseCheckoutPaths) }}:
    76  - pwsh: |
    77      git clone https://github.com/${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} ${{ parameters.WorkingDirectory }}/repo
    78    displayName: Clone Documentation Repository
    79    ignoreLASTEXITCODE: false
    80
    81- ${{ if parameters.SparseCheckoutPaths }}:
    82  - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
    83    parameters:
    84      SkipDefaultCheckout: true
    85      Repositories:
    86        - Name: ${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }}
    87          WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
    88      Paths: ${{ parameters.SparseCheckoutPaths }}
    89
    90- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
    91  parameters:
    92    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
    93- task: PowerShell@2
    94  displayName: 'Apply Documentation Updates From Artifact'
    95  inputs:
    96    targetType: filePath
    97    filePath: ${{ parameters.ScriptDirectory }}/update-docs-metadata.ps1
    98    arguments: >
    99      -ArtifactLocation ${{ parameters.ArtifactLocation }}
   100      -Repository ${{ parameters.PackageRepository }}
   101      -ReleaseSHA ${{ parameters.ReleaseSha }}
   102      -RepoId ${{ parameters.RepoId }}
   103      -WorkDirectory "${{ parameters.WorkingDirectory }}"
   104      -DocRepoLocation "${{ parameters.WorkingDirectory }}/repo"
   105      -Language "${{parameters.Language}}"
   106      -Configs "${{ parameters.CIConfigs }}"
   107    pwsh: true
   108  env:
   109    GH_TOKEN: $(azuresdk-github-pat)
   110
   111- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
   112  parameters:
   113    BaseRepoBranch: $(DefaultBranch)
   114    BaseRepoOwner: ${{ parameters.TargetDocRepoOwner }}
   115    CommitMsg: "Update docs metadata and targeting for release of ${{ parameters.ArtifactName }}"
   116    TargetRepoName: ${{ parameters.TargetDocRepoName }}
   117    TargetRepoOwner: ${{ parameters.TargetDocRepoOwner }}
   118    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
   119    ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}

View as plain text