Skip to content

Commit

Permalink
Enable internal feed and runtime usage via templates (#33919)
Browse files Browse the repository at this point in the history
Uses MIs and NuGetAuthenticate to set up access to internal feeds and runtimes.
  • Loading branch information
mmitche authored Jun 6, 2024
1 parent 0d015c6 commit 27ea548
Showing 1 changed file with 8 additions and 34 deletions.
42 changes: 8 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ variables:
- name: PostBuildSign
value: true
- group: DotNet-HelixApi-Access
- group: DotNetBuilds storage account read tokens
- group: AzureDevOps-Artifact-Feeds-Pats
- name: _InternalRuntimeDownloadArgs
value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
- name: LC_ALL
Expand Down Expand Up @@ -110,14 +108,8 @@ extends:
displayName: 'Set CI tags'
- powershell: SqlLocalDB start
displayName: Start LocalDB
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: NuGetAuthenticate@1
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_InternalBuildArgs) $(_InternalRuntimeDownloadArgs) $(_AdditionalBuildArgs)
env:
Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl)
Expand Down Expand Up @@ -150,14 +142,8 @@ extends:
# Rely on task Arcade injects, not auto-injected build step.
- skipComponentGovernanceDetection: true
steps:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: NuGetAuthenticate@1
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs)
env:
Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl)
Expand Down Expand Up @@ -194,14 +180,8 @@ extends:
echo "##vso[task.setvariable variable=_CosmosToken]$(ef-pr-cosmos-test)"
displayName: Prepare to run Cosmos tests on ef-pr-test
condition: and(eq(variables['_CosmosConnectionUrl'], 'true'), or(endsWith(variables['_runCounter'], '1'), endsWith(variables['_runCounter'], '3'), endsWith(variables['_runCounter'], '5'), endsWith(variables['_runCounter'], '7'), endsWith(variables['_runCounter'], '9')))
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: NuGetAuthenticate@1
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs)
env:
Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl)
Expand Down Expand Up @@ -237,14 +217,8 @@ extends:
inputs:
command: custom
arguments: 'locals all -clear'
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: NuGetAuthenticate@1
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
- script: restore.cmd -ci /p:configuration=$(_BuildConfig) $(_InternalRuntimeDownloadArgs)
displayName: Restore packages
- script: .dotnet\dotnet build eng\helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog $(_InternalRuntimeDownloadArgs)
Expand Down

0 comments on commit 27ea548

Please sign in to comment.