Skip to content

Use containers, also use phases level variables #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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')) }}:
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')) }}:
Expand Down
5 changes: 3 additions & 2 deletions eng/common/templates/phases/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ phases:
queue: ${{ parameters.queue }}

${{ if ne(parameters.variables, '') }}:
variables: ${{ parameters.variables }}
variables:
${{ insert }}: ${{ parameters.variables }}

steps:
- checkout: self
Expand Down Expand Up @@ -104,4 +105,4 @@ phases:
PublishLocation: Container
ArtifactName: AssetManifests
continueOnError: false
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))