2018-10-17 22:17:40 +00:00
|
|
|
parameters:
|
|
|
|
agentOs: ''
|
|
|
|
queue: {}
|
|
|
|
variables: {}
|
|
|
|
|
|
|
|
phases:
|
|
|
|
- template: /eng/common/templates/phases/base.yml
|
|
|
|
parameters:
|
|
|
|
name: ${{ parameters.agentOs }}
|
|
|
|
enableTelemetry: true
|
2018-11-07 07:40:20 +00:00
|
|
|
enableMicrobuild: true
|
2018-10-17 22:17:40 +00:00
|
|
|
publicBuildReasons: PullRequest
|
|
|
|
queue: ${{ parameters.queue }}
|
|
|
|
variables:
|
|
|
|
${{ insert }}: ${{ parameters.variables }}
|
|
|
|
_AgentOSName: ${{ parameters.agentOs }}
|
|
|
|
_HelixType: build/product
|
|
|
|
_HelixBuildConfig: $(_BuildConfig)
|
|
|
|
BuildConfig: $(_BuildConfig)
|
|
|
|
BuildArchitecture: $(_BuildArchitecture)
|
|
|
|
DockerParameter: $(_DockerParameter)
|
|
|
|
LinuxPortable: $(_LinuxPortable)
|
|
|
|
RuntimeId: $(_RuntimeIdentifier)
|
2018-11-09 22:15:41 +00:00
|
|
|
AdditionalBuildParameters: $(_AdditionalBuildParameters)
|
2018-12-19 20:53:08 +00:00
|
|
|
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
|
|
|
_HelixSource: pr/dotnet/core-sdk/$(Build.SourceBranch)
|
|
|
|
_OfficialBuildIdArgs: ''
|
|
|
|
_PublishArgs: ''
|
|
|
|
_SignArgs: ''
|
|
|
|
${{ if ne(variables['System.TeamProject'], 'public') }}:
|
|
|
|
_HelixSource: official/dotnet/core-sdk/$(Build.SourceBranch)
|
|
|
|
_OfficialBuildIdArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
|
2018-12-21 22:58:11 +00:00
|
|
|
_PublishArgs: /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
|
|
|
|
/p:DotnetPublishSdkAssetsBlobFeedUrl=$(PB_PublishBlobFeedUrl)
|
|
|
|
/p:DotNetPublishSdkAssetsBlobFeedKey=$(dotnetcli-storage-key)
|
2018-12-19 20:53:08 +00:00
|
|
|
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
|
|
|
|
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
|
|
|
|
/p:PB_PublishType=$(_PublishType)
|
2018-12-21 22:58:11 +00:00
|
|
|
/p:DotnetPublishChecksumsBlobFeedUrl=$(PB_PublishChecksumsBlobFeedUrl)
|
|
|
|
/p:DotNetPublishChecksumsBlobFeedKey=$(dotnetclichecksums-storage-key)
|
2018-12-19 20:53:08 +00:00
|
|
|
_SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
|
2018-10-17 22:17:40 +00:00
|
|
|
|
|
|
|
steps:
|
2018-12-04 23:23:53 +00:00
|
|
|
- script: 'eng\setbuildinfo.bat $(BuildArchitecture) $(BuildConfig)'
|
2018-11-28 02:48:13 +00:00
|
|
|
condition: eq(variables['_AgentOSName'], 'Windows_NT')
|
|
|
|
displayName: Set test info (Windows)
|
2018-12-04 23:23:53 +00:00
|
|
|
- script: 'eng/setbuildinfo.sh $(BuildArchitecture) $(BuildConfig)'
|
2018-11-28 02:48:13 +00:00
|
|
|
condition: ne(variables['_AgentOSName'], 'Windows_NT')
|
|
|
|
displayName: Set test info (Non-Windows)
|
|
|
|
- script: 'echo TestParameter: $(TestParameter)'
|
|
|
|
displayName: Show TestParameter
|
|
|
|
- script: 'echo RunTests: $(RunTests)'
|
|
|
|
displayName: Show RunTests
|
2018-12-11 22:24:22 +00:00
|
|
|
- script: 'echo AdditionalBuildParameters: $(AdditionalBuildParameters)'
|
|
|
|
displayName: Show AdditionalBuildParameters
|
2018-12-19 20:53:08 +00:00
|
|
|
|
|
|
|
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
|
|
|
- task: AzureKeyVault@1
|
|
|
|
inputs:
|
|
|
|
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
|
|
|
|
KeyVaultName: EngKeyVault
|
2018-12-21 22:58:11 +00:00
|
|
|
SecretsFilter: 'dotnetcli-storage-key,dotnetclichecksums-storage-key,microsoft-symbol-server-pat,symweb-symbol-server-pat'
|
2018-12-19 20:53:08 +00:00
|
|
|
condition: succeeded()
|
|
|
|
- task: AzureKeyVault@1
|
|
|
|
inputs:
|
|
|
|
azureSubscription: 'HelixProd_KeyVault'
|
|
|
|
KeyVaultName: HelixProdKV
|
|
|
|
SecretsFilter: 'HelixApiAccessToken'
|
|
|
|
condition: always()
|
|
|
|
|
2018-10-17 22:17:40 +00:00
|
|
|
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
|
|
|
- script: build.cmd
|
2018-11-28 02:48:13 +00:00
|
|
|
$(TestParameter)
|
2018-12-20 21:52:32 +00:00
|
|
|
-pack -publish -ci
|
2018-10-17 22:17:40 +00:00
|
|
|
-Configuration $(BuildConfig)
|
|
|
|
-Architecture $(BuildArchitecture)
|
2018-12-19 20:53:08 +00:00
|
|
|
$(_PublishArgs)
|
|
|
|
$(_SignArgs)
|
|
|
|
$(_OfficialBuildIdArgs)
|
2018-11-09 22:15:41 +00:00
|
|
|
$(AdditionalBuildParameters)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
env:
|
|
|
|
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
|
|
|
|
DropSuffix: $(_DropSuffix)
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.agentOs, 'Linux') }}:
|
|
|
|
- script: ./build.sh
|
2018-11-28 02:48:13 +00:00
|
|
|
$(TestParameter)
|
2018-12-20 21:52:32 +00:00
|
|
|
--pack --publish --ci
|
2018-11-08 07:20:01 +00:00
|
|
|
--noprettyprint
|
2018-10-17 22:17:40 +00:00
|
|
|
--configuration $(BuildConfig)
|
|
|
|
$(DockerParameter)
|
|
|
|
--architecture $(BuildArchitecture)
|
|
|
|
$(LinuxPortable)
|
|
|
|
$(RuntimeId)
|
2018-12-19 20:53:08 +00:00
|
|
|
$(_PublishArgs)
|
|
|
|
$(_SignArgs)
|
|
|
|
$(_OfficialBuildIdArgs)
|
2018-11-09 22:15:41 +00:00
|
|
|
$(AdditionalBuildParameters)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
env:
|
|
|
|
DropSuffix: $(_DropSuffix)
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.agentOs, 'Darwin') }}:
|
|
|
|
- script: ./build.sh
|
2018-11-28 02:48:13 +00:00
|
|
|
$(TestParameter)
|
2018-12-20 21:52:32 +00:00
|
|
|
--pack --publish --ci
|
2018-11-08 07:20:01 +00:00
|
|
|
--noprettyprint
|
2018-10-17 22:17:40 +00:00
|
|
|
--configuration $(BuildConfig)
|
2018-12-19 20:53:08 +00:00
|
|
|
$(_PublishArgs)
|
|
|
|
$(_SignArgs)
|
|
|
|
$(_OfficialBuildIdArgs)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
|
|
|
|
- task: PublishTestResults@1
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
2018-11-07 07:40:20 +00:00
|
|
|
testRunner: XUnit
|
|
|
|
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
|
2018-11-21 23:57:14 +00:00
|
|
|
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
|
2018-10-17 22:17:40 +00:00
|
|
|
platform: '$(BuildPlatform)'
|
|
|
|
configuration: '$(_BuildConfig)'
|
2018-11-28 02:48:13 +00:00
|
|
|
condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true'), ne(variables['RunTests'], 'false'))
|
2018-10-17 22:17:40 +00:00
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Gather Logs
|
|
|
|
inputs:
|
|
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
|
|
Contents: |
|
2018-11-07 07:40:20 +00:00
|
|
|
artifacts/log/$(_BuildConfig)/**/*
|
|
|
|
artifacts/TestResults/$(_BuildConfig)/**/*
|
2018-10-17 22:17:40 +00:00
|
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
continueOnError: true
|
|
|
|
condition: always()
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish Logs to VSTS
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
|
|
|
|
publishLocation: Container
|
|
|
|
continueOnError: true
|
|
|
|
condition: always()
|