@@ -38,6 +38,10 @@ parameters:
3838  #  Optional: A minimatch pattern for the asset manifests to publish to BAR
3939  assetManifestsPattern : ' */manifests/**/*.xml' 
4040
41+   repositoryAlias : self 
42+ 
43+   officialBuildId : ' ' 
44+ 
4145jobs :
4246- job : Asset_Registry_Publish 
4347
6064      value : false 
6165    #  unconditional - needed for logs publishing (redactor tool version)
6266    - template : /eng/common/core-templates/post-build/common-variables.yml 
67+   - name : OfficialBuildId 
68+     ${{ if ne(parameters.officialBuildId, '') }} :
69+       value : ${{ parameters.officialBuildId }} 
70+     ${{ else }} :
71+       value : $(Build.BuildNumber) 
6372
6473  pool :
6574    #  We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
7887    - ' Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder. ' error 
7988
8089  - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
81-     - checkout : self 
90+     - checkout : ${{ parameters.repositoryAlias }} 
8291      fetchDepth : 3 
8392      clean : true 
8493
@@ -117,12 +126,12 @@ jobs:
117126        azureSubscription : " Darc: Maestro Production" 
118127        scriptType : ps 
119128        scriptLocation : scriptPath 
120-         scriptPath : $(Build.SourcesDirectory )/eng/common/sdk-task.ps1 
129+         scriptPath : $(System.DefaultWorkingDirectory )/eng/common/sdk-task.ps1 
121130        arguments : -task PublishBuildAssets -restore -msbuildEngine dotnet 
122131          /p:ManifestsPath='$(Build.StagingDirectory)/AssetManifests' 
123132          /p:IsAssetlessBuild=${{ parameters.isAssetlessBuild }} 
124133          /p:MaestroApiEndpoint=https://maestro.dot.net 
125-           /p:OfficialBuildId=$(Build.BuildNumber ) 
134+           /p:OfficialBuildId=$(OfficialBuildId ) 
126135      condition : ${{ parameters.condition }} 
127136      continueOnError : ${{ parameters.continueOnError }} 
128137
@@ -137,7 +146,7 @@ jobs:
137146          Add-Content -Path $filePath -Value "$(DefaultChannels)" 
138147          Add-Content -Path $filePath -Value $(IsStableBuild) 
139148
140-           $symbolExclusionfile = "$(Build.SourcesDirectory )/eng/SymbolPublishingExclusionsFile.txt" 
149+           $symbolExclusionfile = "$(System.DefaultWorkingDirectory )/eng/SymbolPublishingExclusionsFile.txt" 
141150          if (Test-Path -Path $symbolExclusionfile) 
142151          { 
143152            Write-Host "SymbolExclusionFile exists" 
@@ -177,7 +186,7 @@ jobs:
177186          azureSubscription : " Darc: Maestro Production" 
178187          scriptType : ps 
179188          scriptLocation : scriptPath 
180-           scriptPath : $(Build.SourcesDirectory )/eng/common/post-build/publish-using-darc.ps1 
189+           scriptPath : $(System.DefaultWorkingDirectory )/eng/common/post-build/publish-using-darc.ps1 
181190          arguments : > 
182191            -BuildId $(BARBuildId) 
183192            -PublishingInfraVersion 3 
0 commit comments