From e7021191775dbbb0556d648a0790491bf75facd7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 6 Nov 2018 09:52:14 -0800 Subject: [PATCH] Add code to use private NuGet feeds when running in internal CI system (#8187) Add code to use private NuGet feeds when running in internal CI system --- .vsts-ci/linux.yml | 12 +++++++++--- .vsts-ci/mac.yml | 12 +++++++++--- .vsts-ci/windows.yml | 12 +++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index df15463434..943487560e 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -51,9 +51,15 @@ phases: condition: succeededOrFailed() - powershell: | - git submodule update --init - displayName: SubModule Init - condition: succeededOrFailed() + Import-Module $(Build.SourcesDirectory)/build.psm1 -Force + New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules + + if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config")) + { + throw "nuget.config is not created" + } + displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules ' + condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], '')) - powershell: | tools/travis.ps1 -Stage Bootstrap diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index f3df0aab4b..51bbefc566 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -26,9 +26,15 @@ phases: condition: ne(variables['Build.Reason'], 'PullRequest') - powershell: | - git submodule update --init - displayName: SubModule Init - condition: succeededOrFailed() + Import-Module $(Build.SourcesDirectory)/build.psm1 -Force + New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules + + if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config")) + { + throw "nuget.config is not created" + } + displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules ' + condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], '')) - powershell: | tools/travis.ps1 -Stage Bootstrap diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index 80da3a8743..bf26369a1f 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -30,9 +30,15 @@ steps: condition: ne(variables['Build.Reason'], 'PullRequest') - powershell: | - git submodule update --init - displayName: SubModule Init - condition: succeededOrFailed() + Import-Module $(Build.SourcesDirectory)/build.psm1 -Force + New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules + + if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config")) + { + throw "nuget.config is not created" + } + displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules ' + condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], '')) - powershell: | [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12