Skip to content

Commit 7e4def4

Browse files
Abe27342Abram Sanderson
authored andcommitted
Allow specifying primary registry in include-install-pnpm.yaml (microsoft#25540)
## Description Follow-up to microsoft#25535 that allows specifying the primary registry in `include-install-pnpm.yaml` so that the telemetry stage upload template can reference the feed we use to install internal packages. Test run [here](https://dev.azure.com/fluidframework/internal/_build/results?buildId=357059&view=logs&j=7ef2f12f-27d7-5730-657b-d3ad5f630362&t=9da23dd1-2e0f-578e-ea27-ee9162e0f22c). Co-authored-by: Abram Sanderson <absander@microsoft.com>
1 parent 9c14d82 commit 7e4def4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tools/pipelines/templates/include-install-pnpm.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ parameters:
2727
type: string
2828
default: $(Agent.TempDirectory)/.npmrc
2929

30+
- name: primaryRegistry
31+
type: string
32+
default: $(ado-feeds-primary-registry)
33+
3034
steps:
3135
- ${{ if eq(parameters.enableCache, true) }}:
3236
- task: Cache@2
@@ -69,13 +73,13 @@ steps:
6973
echo "##vso[task.setvariable variable=registryType]private"
7074
fi
7175
env:
72-
NPM_REGISTRY: $(ado-feeds-primary-registry)
76+
NPM_REGISTRY: ${{ parameters.primaryRegistry }}
7377
NPM_CONFIG_USERCONFIG: ${{ parameters.userNpmrcPath}}
7478
# We should leverage the primary npm registry to install pnpm as well. However, ADO artifacts feeds do not implement
7579
# the full npm registry API including a route that corepack uses to get package metadata--the version route here:
7680
# https://github.com/nodejs/corepack/blob/bc13d40037d0b1bfd386e260ae741f55505b5c7c/sources/npmRegistryUtils.ts#L32
7781
# Thus installing pnpm from an ADO feed using corepack is not possible at time of writing.
78-
# COREPACK_NPM_REGISTRY: $(ado-feeds-primary-registry)
82+
# COREPACK_NPM_REGISTRY: ${{ parameters.primaryRegistry }}
7983

8084
# Authenticate to npm feed if required
8185
- task: npmAuthenticate@0

tools/pipelines/templates/include-upload-stage-telemetry.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ stages:
4949
- template: /tools/pipelines/templates/include-install-pnpm.yml@self
5050
parameters:
5151
buildDirectory: $(Build.SourcesDirectory)
52+
primaryRegistry: $(ado-feeds-ff-download-only)
5253

5354
- task: Bash@3
5455
displayName: 'Install dependencies'

0 commit comments

Comments
 (0)