-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipelines.yml
72 lines (62 loc) · 2.28 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
branches:
include:
- master
# This was meant to exclude DotnetFramework.Test from building, but I couldn't get it to work
# paths:
# exclude:
# - DotnetFramework.Test\DotnetFramework.Test.csproj
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
#Excellent docs on .NET Core steps: https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops#feedback
steps:
- script: set
displayName: show all variables
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration Release' # Update this to match your need
#need to use the vso tasks so that the env variables persist trhough tasks in ADO
- powershell: |
Write-Host "Our Sauce Username in ADO is=> $($env:SAUCE_USER)";
Write-Host "Our Sauce Access Key in ADO is=> $($env:SAUCE_KEY)";
Write-Host "System.DefaultWorkingDirectory=>$(System.DefaultWorkingDirectory)"
Write-Host "Build.ArtifactStagingDirectory=>$(Build.ArtifactStagingDirectory)"
Write-Host ("##vso[task.setvariable variable=SAUCE_USERNAME]$($env:SAUCE_USER)")
Write-Host ("##vso[task.setvariable variable=SAUCE_ACCESS_KEY]$($env:SAUCE_KEY)")
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: test
projects: '**/*Test/*.csproj'
arguments: '--configuration $(buildConfiguration)'
# Pack a NuGet package to a test directory
- task: DotNetCoreCLI@2
displayName: 'Pack NuGet'
inputs:
command: 'pack'
outputDir: '$(Build.ArtifactStagingDirectory)/TestDir'
#- task: NuGetCommand@2
# displayName: publish
# condition: and(succeeded(), or(eq(variables['Build.SourceBranchName'], 'master'),eq(variables['Build.SourceBranchName'], 'develop')))
# inputs:
# command: push
# nuGetFeedType: external
# publishFeedCredentials: 'NuGet'
# packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'