forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes to Azure Public feed usage (PowerShell#24149)
* Fix code PATs * Fix feed PATs * remove gallery commit * update feed url * Update to new variable groups * Fix Variable name * Fix credential template * Disable Signing setup in prep stage * Capture nuget source list * lock down the firewall * Add creds to feed switch to allow single switch location * Use switch from build.psm1 * Use switch template instead of commands * update to test feed * disable codeql in jobs where we don't compile * disable code sign validation for prep * move capture steps to restore phase to see if it speeds things up * remove duplicate capture of nuget config * update test service * Only build windows test service on windows * warn when no config is generated * try to fix test service * fix web listener refs * try removing dotnet tool * update feedname with user info * update package version that is not found * try moving failing jobs to restore phase * allow nuget inset in either phase * update package ref * use the right reporoot * Move everything to restore * Try adding build phase * put nuget files in the right place * move bootstrap into yaml * remove onebranch agent items from macos build * switch to environment variable * bump a couple of packages * fix formatting * Fix static analysis issue * update feed url to test restoring everything * install the AzFeed cred provider * fix binlog issues
- Loading branch information
1 parent
8c98b5c
commit 5919a24
Showing
27 changed files
with
237 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,53 @@ | ||
parameters: | ||
- name: "repoRoot" | ||
default: $(REPOROOT) | ||
- name: "ob_restore_phase" | ||
type: boolean | ||
default: true | ||
|
||
steps: | ||
- task: NuGetAuthenticate@1 | ||
displayName: Install Azure Artifacts Credential Provider | ||
inputs: | ||
forceReinstallCredentialProvider: true | ||
|
||
- pwsh: | | ||
$configPath = "${env:NugetConfigDir}/nuget.config" | ||
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force | ||
try { | ||
$configPath = "${env:NugetConfigDir}/nuget.config" | ||
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force | ||
$powerShellPublicPackages = New-NugetPackageSource -Url '$(PowerShellCore_PublicPackages)' -Name 'AzDevOpsFeed' | ||
Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)'" | ||
Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)' | ||
New-NugetConfigFile -NugetPackageSource $powerShellPublicPackages -UserName $(AzDevopsFeedUserNameKVPAT) -ClearTextPAT $(mscodehubPackageReadPat) -Destination "${env:NugetConfigDir}" | ||
if(-not (Test-Path $configPath)) | ||
{ | ||
throw "nuget.config is not created" | ||
if(-not (Test-Path $configPath)) | ||
{ | ||
throw "nuget.config is not created" | ||
} | ||
} | ||
Get-Content $configPath | Write-Verbose -Verbose | ||
displayName: 'Add nuget.config for Azure DevOps feed for PSGallery modules' | ||
condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], '')) | ||
catch { | ||
Get-Error | ||
throw | ||
} | ||
displayName: 'Switch to production Azure DevOps feed for all nuget.configs' | ||
condition: and(succeededOrFailed(), ne(variables['UseAzDevOpsFeed'], '')) | ||
env: | ||
NugetConfigDir: ${{ parameters.repoRoot }}/src/Modules | ||
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase | ||
ob_restore_phase: ${{ parameters.ob_restore_phase }} | ||
|
||
- pwsh: | | ||
$configPath = "${env:NugetConfigDir}/nuget.config" | ||
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force | ||
$powerShellPublicPackages = New-NugetPackageSource -Url '$(PowerShellCore_PublicPackages)' -Name 'AzDevOpsFeed' | ||
New-NugetConfigFile -NugetPackageSource $powerShellPublicPackages -UserName $(AzDevopsFeedUserNameKVPAT) -ClearTextPAT $(mscodehubPackageReadPat) -Destination "${env:NugetConfigDir}" | ||
if (-not (Test-Path $configPath)) | ||
{ | ||
throw "nuget.config is not created" | ||
Get-ChildItem ${{ parameters.repoRoot }}/nuget.config -Recurse | Foreach-Object { | ||
Write-Verbose -Verbose "--- START $($_.fullname) ---" | ||
get-content $_.fullname | Out-String -width 9999 -Stream | write-Verbose -Verbose | ||
Write-Verbose -Verbose "--- END $($_.fullname) ---" | ||
} | ||
Get-Content $configPath | Write-Verbose -Verbose | ||
displayName: 'Add nuget.config for Azure DevOps feed for packages' | ||
condition: and(succeededOrFailed(), ne(variables['PSInternalNugetFeed'], '')) | ||
displayName: 'Capture all nuget.config files' | ||
condition: and(succeededOrFailed(), ne(variables['UseAzDevOpsFeed'], '')) | ||
env: | ||
ob_restore_phase: ${{ parameters.ob_restore_phase }} | ||
|
||
- pwsh: | | ||
Get-ChildItem -Path env:VSS* | Out-String -width 9999 -Stream | write-Verbose -Verbose | ||
displayName: Capture VSS* Environment | ||
condition: and(succeededOrFailed(), ne(variables['UseAzDevOpsFeed'], '')) | ||
env: | ||
NugetConfigDir: ${{ parameters.repoRoot }} | ||
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase | ||
ob_restore_phase: ${{ parameters.ob_restore_phase }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.