|
1 | 1 | steps: |
2 | | -- task: PipAuthenticate@1 |
3 | | - displayName: 'Pip Authenticate' |
4 | | - inputs: |
5 | | - # Authenticates the dotnet-public-pypi feed (a full pypi mirror) and sets |
6 | | - # PIP_INDEX_URL to the authenticated URL. Dockerfiles that install Helix |
7 | | - # wheels override the index per-command to point at helix-client-prod and |
8 | | - # use this value as --extra-index-url so transitive deps fall back to the |
9 | | - # full mirror when the curated Helix feed lacks a matching wheel. |
10 | | - artifactFeeds: public/dotnet-public-pypi,public/helix-client-prod |
11 | | - onlyAddExtraIndex: false |
12 | | -- powershell: | |
13 | | - $options = "$(imageBuilderBuildArgs)" |
14 | | - $options += " --build-arg PIP_INDEX_URL=$env:PIP_INDEX_URL --build-arg NPM_TOKEN=$(System.AccessToken)" |
15 | | - echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$options" |
16 | | - displayName: Set PIP and NPM Build Args |
| 2 | +# Provide PIP_INDEX_URL (and, internally, NPM_TOKEN) as image build args. |
| 3 | +# Dockerfiles that install Helix wheels override the index per-command to point |
| 4 | +# at helix-client-prod and use PIP_INDEX_URL as --extra-index-url so transitive |
| 5 | +# deps fall back to the full dotnet-public-pypi mirror when the curated Helix |
| 6 | +# feed lacks a matching wheel. |
| 7 | +# |
| 8 | +# Both feeds live in the dnceng org's public project. Internally we authenticate |
| 9 | +# them (so the pypi mirror can pull packages through from upstream and to avoid |
| 10 | +# anonymous throttling). In the public project those feeds are in a different |
| 11 | +# org and a fork-PR token can't authenticate them, but they are anonymously |
| 12 | +# readable, so we point PIP_INDEX_URL straight at the mirror with no token. |
| 13 | +- ${{ if eq(variables['System.TeamProject'], 'internal') }}: |
| 14 | + - task: PipAuthenticate@1 |
| 15 | + displayName: 'Pip Authenticate' |
| 16 | + inputs: |
| 17 | + artifactFeeds: public/dotnet-public-pypi,public/helix-client-prod |
| 18 | + onlyAddExtraIndex: false |
| 19 | + - powershell: | |
| 20 | + $options = "$(imageBuilderBuildArgs)" |
| 21 | + $options += " --build-arg PIP_INDEX_URL=$env:PIP_INDEX_URL --build-arg NPM_TOKEN=$(System.AccessToken)" |
| 22 | + echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$options" |
| 23 | + displayName: Set PIP and NPM Build Args |
| 24 | +- ${{ else }}: |
| 25 | + - powershell: | |
| 26 | + $options = "$(imageBuilderBuildArgs)" |
| 27 | + $options += " --build-arg PIP_INDEX_URL=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-pypi/pypi/simple/" |
| 28 | + echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$options" |
| 29 | + displayName: Set Public PIP Build Arg |
0 commit comments