Skip to content

Commit a40cddb

Browse files
authored
Swap RS publish to ordinary pool using service connection (#1855) (#1859)
1 parent b94a975 commit a40cddb

File tree

7 files changed

+89
-122
lines changed

7 files changed

+89
-122
lines changed

eng/pipeline/stages/builders-to-stages.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,15 @@ stages:
8383

8484
- ${{ if eq(parameters.publish, true) }}:
8585
- ${{ if parameters.ctx['GoPublishReleaseStudio'] }}:
86-
- template: public-publish-stages.yml
86+
- template: pool.yml
8787
parameters:
8888
ctx: ${{ parameters.ctx }}
89-
publishExistingRunID: ${{ parameters.publishExistingRunID }}
89+
inner:
90+
template: public-publish-stages.yml
91+
parameters:
92+
ctx: ${{ parameters.ctx }}
93+
builder: { os: windows, arch: amd64, distro: '2022' }
94+
publishExistingRunID: ${{ parameters.publishExistingRunID }}
9095

9196
# If publishing, always publish the results to a private storage account and
9297
# publish symbols to AzDO.

eng/pipeline/stages/public-publish-stage.yml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ parameters:
1111
- name: ctx
1212
type: object
1313

14+
- name: pool
15+
type: object
16+
1417
- name: id
1518
type: string
1619

@@ -35,47 +38,61 @@ stages:
3538

3639
jobs:
3740
- job: ${{ parameters.id }}
38-
pool:
39-
name: DotNet-Publishing-1ES-MI
41+
pool: ${{ parameters.pool }}
4042
workspace:
4143
clean: all
4244
timeoutInMinutes: 240 # 4hr
4345
${{ if parameters.templateContext }}:
4446
templateContext: ${{ parameters.templateContext }}
4547
variables:
4648
# Group includes these relevant variables:
47-
# - MI_ClientId
4849
# - ReleaseStudioPublishOwnerAliases
4950
- group: go-release-config
5051

51-
- name: GoBinariesDir
52-
value: $(Pipeline.Workspace)/Binaries Signed
53-
- name: NetCorePublishingScripts
54-
value: $(Build.SourcesDirectory)/eng/release-studio/bin/MsGoPublishingScripts
55-
5652
# This is read directly by release studio scripts through env.
5753
- name: RMExecutionEnvironment
5854
value: Production
5955

56+
- name: GoBinariesDir
57+
value: $(Pipeline.Workspace)/Binaries Signed
58+
59+
- name: NetCorePublishingScriptsPackages
60+
value: $(Build.SourcesDirectory)/eng/artifacts/MsGoPublishingScripts/Packages
61+
6062
- ${{ each variable in parameters.variables }}:
6163
- ${{ variable }}
6264
steps:
6365
- template: ../steps/checkout-windows-task.yml
6466
- template: ../steps/find-PublishBranchAlias-task.yml
6567

66-
- task: NuGetAuthenticate@1
67-
displayName: 'Authenticate to AzDO Feeds'
68-
69-
- task: DotNetCoreCLI@2
70-
displayName: 'Acquire tools using csproj'
68+
# Install the latest version of the publish tools package. The
69+
# floating dependency is recommended by the RM team to allow them to
70+
# make updates to the system. UI to fetch the package as a dev is at:
71+
# https://dev.azure.com/dnceng/internal/_artifacts/feed/MicroBuildToolset/NuGet/DevDiv.RM.MS.Go.Publishing
72+
- task: NuGetCommand@2
73+
displayName: NuGet install RM Tools Package
7174
inputs:
7275
command: custom
73-
projects: '$(Build.SourcesDirectory)/eng/release-studio/ReleaseStudio.csproj'
74-
custom: build
76+
feedRestore: MicroBuildToolset
7577
arguments: >-
76-
/p:NetCorePublishingScripts=$(NetCorePublishingScripts)
77-
/bl:eng/release-studio/Build.binlog
78-
/v:n
78+
install DevDiv.RM.MS.Go.Publishing
79+
-Source https://pkgs.dev.azure.com/dnceng/_packaging/MicroBuildToolset/nuget/v3/index.json
80+
-OutputDirectory $(NetCorePublishingScriptsPackages)
81+
-Verbosity Detailed
82+
83+
- pwsh: |
84+
$packageDir = Get-ChildItem `
85+
-Path $(NetCorePublishingScriptsPackages) `
86+
-Filter "DevDiv.RM.MS.Go.Publishing*" `
87+
-Directory
88+
89+
Write-Host "Tools package dir: $packageDir"
90+
if ($packageDir.Count -ne 1) {
91+
throw "Expected exactly one publishing tools package installed, found $($packageDir.Count)."
92+
}
93+
94+
Write-Output "##vso[task.setvariable variable=NetCorePublishingScripts]$packageDir\scripts"
95+
displayName: Find RM Tools scripts directory
7996
8097
- ${{ each step in parameters.steps }}:
8198
- ${{ step }}

eng/pipeline/stages/public-publish-stages.yml

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ parameters:
99
- name: ctx
1010
type: object
1111

12+
- name: pool
13+
type: object
14+
1215
- name: publishExistingRunID
1316
type: string
1417
default: 'nil'
1518

19+
# Unused. Declared so pool selection doesn't fail when trying to pass them.
20+
- name: builder
21+
type: object
22+
1623
stages:
1724
- template: public-publish-stage.yml
1825
parameters:
1926
ctx: ${{ parameters.ctx }}
27+
pool: ${{ parameters.pool }}
2028

2129
id: PublishPublicBinaries
2230

@@ -30,13 +38,14 @@ stages:
3038
parameters:
3139
runID: ${{ parameters.publishExistingRunID }}
3240

33-
- task: PowerShell@2
41+
- task: AzurePowerShell@5
3442
displayName: ➡️ Send Publishing Request To Release Studio
3543
inputs:
36-
targetType: filePath
37-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.SendPublishRequest.ps1'
38-
arguments:
39-
-MIClientId "$(MI_ClientId)"
44+
ScriptType: FilePath
45+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.SendPublishRequest.ps1'
46+
azureSubscription: 'golang-dnceng-rs-publish'
47+
azurePowerShellVersion: 'LatestVersion'
48+
ScriptArguments:
4049
-PublishingFilesPath "$(GoBinariesDir)"
4150
-BuildNumber "$(Build.BuildNumber)"
4251
-BranchName "$(PublishBranchAlias)"
@@ -51,6 +60,7 @@ stages:
5160
- template: public-publish-stage.yml
5261
parameters:
5362
ctx: ${{ parameters.ctx }}
63+
pool: ${{ parameters.pool }}
5464
id: WaitPublicBinaries
5565
dependsOn: PublishPublicBinaries
5666
variables:
@@ -64,31 +74,34 @@ stages:
6474
path: $(ReleaseStudioBinariesManifestDir)
6575
artifact: Release Studio Binaries Manifest
6676
steps:
67-
- task: PowerShell@2
77+
- task: AzurePowerShell@5
6878
displayName: ⌚ Wait for Publishing Request Completion
6979
inputs:
70-
targetType: filePath
71-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.WaitForPublishingRequestToBeLive.ps1'
72-
arguments:
73-
-MIClientId "$(MI_ClientId)"
80+
ScriptType: FilePath
81+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.WaitForPublishingRequestToBeLive.ps1'
82+
azureSubscription: 'golang-dnceng-rs-publish'
83+
azurePowerShellVersion: 'LatestVersion'
84+
ScriptArguments:
7485
-RequestId "$(RequestID)"
7586

7687
- pwsh: New-Item "$(ReleaseStudioBinariesManifestDir)" -ItemType Directory -ErrorAction Ignore
7788
displayName: 'Create Publish Manifest File Output Directory'
7889

79-
- task: PowerShell@2
90+
- task: AzurePowerShell@5
8091
displayName: 🗃️ Create Publish Manifest File
8192
inputs:
82-
targetType: filePath
83-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.CreateOutputManifestFile.ps1'
84-
arguments:
85-
-MIClientId "$(MI_ClientId)"
93+
ScriptType: FilePath
94+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.CreateOutputManifestFile.ps1'
95+
azureSubscription: 'golang-dnceng-rs-publish'
96+
azurePowerShellVersion: 'LatestVersion'
97+
ScriptArguments:
8698
-OutputDirectory "$(ReleaseStudioBinariesManifestDir)"
8799
-RequestId "$(RequestID)"
88100

89101
- template: public-publish-stage.yml
90102
parameters:
91103
ctx: ${{ parameters.ctx }}
104+
pool: ${{ parameters.pool }}
92105
id: PublishAssetManifest
93106
dependsOn: WaitPublicBinaries
94107
variables:
@@ -121,13 +134,14 @@ stages:
121134
-o '$(BuildAssetsPrePublishDir)/assets.json'
122135
displayName: 🏗️ Create build asset JSON
123136
124-
- task: PowerShell@2
137+
- task: AzurePowerShell@5
125138
displayName: ➡️ Send Publishing Request To Release Studio
126139
inputs:
127-
targetType: filePath
128-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.SendPublishRequest.ps1'
129-
arguments:
130-
-MIClientId "$(MI_ClientId)"
140+
ScriptType: FilePath
141+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.SendPublishRequest.ps1'
142+
azureSubscription: 'golang-dnceng-rs-publish'
143+
azurePowerShellVersion: 'LatestVersion'
144+
ScriptArguments:
131145
-PublishingFilesPath "$(BuildAssetsPrePublishDir)"
132146
-BuildNumber "$(Build.BuildNumber)"
133147
-BranchName "$(PublishBranchAlias)"
@@ -142,6 +156,7 @@ stages:
142156
- template: public-publish-stage.yml
143157
parameters:
144158
ctx: ${{ parameters.ctx }}
159+
pool: ${{ parameters.pool }}
145160
id: WaitAssetManifest
146161
dependsOn: PublishAssetManifest
147162
variables:
@@ -160,25 +175,27 @@ stages:
160175
path: $(ReleaseStudioMetaManifestDir)
161176
artifact: Release Studio Meta Manifest
162177
steps:
163-
- task: PowerShell@2
178+
- task: AzurePowerShell@5
164179
displayName: ⌚ Wait for Publishing Request Completion
165180
inputs:
166-
targetType: filePath
167-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.WaitForPublishingRequestToBeLive.ps1'
168-
arguments:
169-
-MIClientId "$(MI_ClientId)"
181+
ScriptType: FilePath
182+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.WaitForPublishingRequestToBeLive.ps1'
183+
azureSubscription: 'golang-dnceng-rs-publish'
184+
azurePowerShellVersion: 'LatestVersion'
185+
ScriptArguments:
170186
-RequestId "$(RequestID)"
171187

172188
- pwsh: New-Item "$(ReleaseStudioMetaManifestDir)" -ItemType Directory -ErrorAction Ignore
173189
displayName: 'Create Meta Manifest File Output Directory'
174190

175-
- task: PowerShell@2
191+
- task: AzurePowerShell@5
176192
displayName: 🗃️ Create Meta Manifest File
177193
inputs:
178-
targetType: filePath
179-
filePath: '$(NetCorePublishingScripts)/RM.MsGo.CreateOutputManifestFile.ps1'
180-
arguments:
181-
-MIClientId "$(MI_ClientId)"
194+
ScriptType: FilePath
195+
ScriptPath: '$(NetCorePublishingScripts)/RM.MsGo.CreateOutputManifestFile.ps1'
196+
azureSubscription: 'golang-dnceng-rs-publish'
197+
azurePowerShellVersion: 'LatestVersion'
198+
ScriptArguments:
182199
-OutputDirectory "$(ReleaseStudioMetaManifestDir)"
183200
-RequestId "$(RequestID)"
184201

eng/release-studio/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

eng/release-studio/NuGet.config

Lines changed: 0 additions & 15 deletions
This file was deleted.

eng/release-studio/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

eng/release-studio/ReleaseStudio.csproj

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)