From 6ad54ecb4a9562dc6092a2fc0e2908fc09b2c034 Mon Sep 17 00:00:00 2001 From: Christopher Costa Date: Mon, 1 Oct 2018 10:07:38 -0700 Subject: [PATCH] Use containers, also use phases level variables --- .vsts-ci.yml | 17 ++++++++++++++--- eng/build.yml | 4 ---- eng/common/templates/phases/base.yml | 5 +++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 2eafe4b6699..e21505cfb87 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -1,3 +1,16 @@ +variables: + _HelixType: build/product + ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + _HelixSource: pr/dotnet/arcade/$(Build.SourceBranch) + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + _TeamName: DotNetCore + _HelixSource: official/dotnet/arcade/$(Build.SourceBranch) + +resources: + containers: + - container: LinuxContainer + image: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20170319080304 + phases: - template: /eng/build.yml parameters: @@ -32,7 +45,7 @@ phases: parameters: name: Linux queue: - # Temporarily, use the linux pool while the hosted preview doesn't have docker support. + container: LinuxContainer ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: name: dnceng-linux-external-temp ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -49,8 +62,6 @@ phases: _PublishType: none _SignType: none _DotNetPublishToBlobFeed : false - variables: - _PREVIEW_VSTS_DOCKER_IMAGE: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20170319080304 - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - template: /eng/common/templates/phases/publish-build-assets.yml diff --git a/eng/build.yml b/eng/build.yml index 0a901782c79..b2547755023 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -29,28 +29,24 @@ phases: variables: ${{ insert }}: ${{ parameters.variables }} - _HelixType: build/product _HelixBuildConfig: $(_BuildConfig) # Only enable publishing in non-public, non PR scenarios. ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: # This should be changed to an isolated blob feed per-build. # Right now a manual build of a random branch would get published alongside the normal branch artifacts. _PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - _TeamName: DotNetCore _SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) _PublishArgs: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) /p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl) /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed) /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - _HelixSource: official/dotnet/arcade/$(Build.SourceBranch) _OfficialBuildIdArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) # else ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: _PublishArgs: '' _OfficialBuildIdArgs: '' _SignArgs: '' - _HelixSource: pr/dotnet/arcade/$(Build.SourceBranch) steps: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: diff --git a/eng/common/templates/phases/base.yml b/eng/common/templates/phases/base.yml index 79b42b18354..c7933eafa56 100644 --- a/eng/common/templates/phases/base.yml +++ b/eng/common/templates/phases/base.yml @@ -41,7 +41,8 @@ phases: queue: ${{ parameters.queue }} ${{ if ne(parameters.variables, '') }}: - variables: ${{ parameters.variables }} + variables: + ${{ insert }}: ${{ parameters.variables }} steps: - checkout: self @@ -104,4 +105,4 @@ phases: PublishLocation: Container ArtifactName: AssetManifests continueOnError: false - condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) \ No newline at end of file + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))