64 строки
1.8 KiB
YAML
64 строки
1.8 KiB
YAML
name: $(Build.SourceBranchName)_$(Build.Reason)_$(devops_buildNumber)
|
|
|
|
trigger:
|
|
- v3.x
|
|
- main
|
|
|
|
pool:
|
|
vmImage: 'windows-2019'
|
|
|
|
variables:
|
|
devops_buildNumber: $[counter(format(''), 289)]
|
|
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: 'Set dotnet path'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$infoContent = dotnet --info
|
|
$sdkBasePath = $infoContent |
|
|
Where-Object {$_ -match 'Base Path:'} |
|
|
ForEach-Object {
|
|
($_ -replace '\s+Base Path:','').trim()
|
|
}
|
|
Write-Host "dotnet SDK path: $sdkBasePath"
|
|
$dotnetPath = (Get-Item $sdkBasePath).Parent.Parent.FullName
|
|
Write-Host "dotnet path: $dotnetPath"
|
|
Write-Host "##vso[task.setvariable variable=DotNetPath]$dotnetPath"
|
|
- task: UseDotNet@2
|
|
displayName: 'Install dotnet v2.x'
|
|
inputs:
|
|
packageType: 'sdk'
|
|
version: '2.2.207'
|
|
installationPath: $(DotNetPath)
|
|
- task: UseDotNet@2
|
|
displayName: 'Install dotnet v3.x'
|
|
inputs:
|
|
packageType: 'sdk'
|
|
version: '3.1.x'
|
|
performMultiLevelLookup: true
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
.paket\paket.exe install
|
|
packages\FAKE\tools\fake .\build.fsx
|
|
env:
|
|
FILES_ACCOUNT_KEY: $(FILES_ACCOUNT_KEY)
|
|
FILES_ACCOUNT_NAME: $(FILES_ACCOUNT_NAME)
|
|
BUILD_VERSION: 1.1.$(devops_buildNumber)
|
|
displayName: 'Build'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Run End to End tests'
|
|
inputs:
|
|
command: 'test'
|
|
projects: '.\FunctionsSdkE2ETests\FunctionsSdkE2ETests.sln'
|
|
arguments: '-v n'
|
|
- pwsh: |
|
|
Move-Item -Path '$(Build.Repository.LocalPath)\artifacts\Microsoft.NET.Sdk.Functions.*' -Destination '$(Build.ArtifactStagingDirectory)'
|
|
displayName: 'Move artifacts'
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: 'drop'
|
|
publishLocation: 'Container' |