-
Notifications
You must be signed in to change notification settings - Fork 736
Enforce CFSClean network isolation in 1ES pipelines #5194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9e6f8f9
Enforce CFSClean network isolation
Copilot d1679cf
Install pinned pnpm in pipelines
Copilot 4c0a530
Authenticate npm in isolated pipelines
Copilot eb3ac77
Route extension tests through authenticated registry
Copilot 51953db
Merge branch 'main' into copilot/port-pr-504
mikeharder 2b2df35
[getPackageVersions] Respect autorest_registry env var
mikeharder 98de2a8
Merge branch 'main' into copilot/port-pr-504
mikeharder 9e350f0
Enable Python CFS when running regression tests
mikeharder fce87d0
Merge branch 'copilot/port-pr-504' of https://github.com/Azure/autore…
mikeharder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| parameters: | ||
| - name: npmrcPath | ||
| type: string | ||
| # When empty, defaults to the agent user's .npmrc ($HOME/.npmrc on | ||
| # Linux/macOS, %USERPROFILE%\.npmrc on Windows) so every subsequent | ||
| # npm / pnpm / npx call in the job inherits the registry + auth. | ||
| default: "" | ||
| - name: registryUrl | ||
| type: string | ||
| default: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" | ||
| - name: CustomCondition | ||
| type: string | ||
| default: succeeded() | ||
| - name: ServiceConnection | ||
| type: string | ||
| default: "" | ||
|
|
||
| steps: | ||
| - pwsh: | | ||
| $npmrcPath = '${{ parameters.npmrcPath }}' | ||
| if (-not $npmrcPath) { $npmrcPath = Join-Path $HOME '.npmrc' } | ||
|
|
||
| Write-Host "Creating .npmrc file $npmrcPath for registry ${{ parameters.registryUrl }}" | ||
| $parentFolder = Split-Path -Path $npmrcPath -Parent | ||
|
|
||
| if ($parentFolder -and -not (Test-Path $parentFolder)) { | ||
| Write-Host "Creating folder $parentFolder" | ||
| New-Item -Path $parentFolder -ItemType Directory | Out-Null | ||
| } | ||
|
|
||
| "registry=${{ parameters.registryUrl }}" | Out-File $npmrcPath | ||
| Write-Host "##vso[task.setvariable variable=resolvedNpmrcPath]$npmrcPath" | ||
| Write-Host "##vso[task.setvariable variable=resolvedNpmRegistryUrl]${{ parameters.registryUrl }}" | ||
| displayName: "Create .npmrc" | ||
| condition: ${{ parameters.CustomCondition }} | ||
|
|
||
| - task: npmAuthenticate@0 | ||
| displayName: Authenticate .npmrc | ||
| condition: ${{ parameters.CustomCondition }} | ||
| inputs: | ||
| workingFile: $(resolvedNpmrcPath) | ||
| azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| steps: | ||
| - pwsh: | | ||
| $packageJson = Get-Content -Raw "$(Build.SourcesDirectory)/package.json" | ConvertFrom-Json | ||
| npm install -g $packageJson.packageManager | ||
| displayName: Install pnpm |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.