forked from mikegore1000/SimpleEventStore
-
Notifications
You must be signed in to change notification settings - Fork 24
/
azure-pipelines.yml
99 lines (91 loc) · 3.07 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# https://aka.ms/yaml
trigger:
- main
- main
pr:
- main
pool:
vmImage: windows-latest
stages:
- stage: Build
displayName: Build
jobs:
- job: Build
steps:
- checkout: self
fetchDepth: 0
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: Determine GitVersion
inputs:
useConfigFile: true
configFilePath: $(Build.SourcesDirectory)/GitVersion.yml
targetPath: $(Build.SourcesDirectory)
- task: PowerShell@2
displayName: Starting Cosmos DB Emulator
inputs:
containerName: 'azure-cosmosdb-emulator'
enableAPI: 'SQL'
portMapping: '8081:8081, 8901:8901, 8902:8902, 8979:8979, 10250:10250, 10251:10251, 10252:10252, 10253:10253, 10254:10254, 10255:10255, 10256:10256, 10350:10350'
hostDirectory: '$(Build.BinariesDirectory)\azure-cosmosdb-emulator'
consistency: 'BoundedStaleness'
targetType: 'inline'
workingDirectory: $(Pipeline.Workspace)
script: |
Write-Host "Starting CosmosDB Emulator"
Import-Module "C:/Program Files/Azure Cosmos DB Emulator/PSModules/Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator
- task: PowerShell@2
displayName: Build and Test
inputs:
filePath: '.\build.ps1'
# arguments: '-Uri $(CosmosDbEmulator.Endpoint)'
# - task: PublishTestResults@2
# condition: succeededOrFailed()
# inputs:
# testRunner: VSTest
# testResultsFiles: '**/*.trx'
- task: DotNetCoreCLI@2
displayName: Package
inputs:
command: "pack"
versioningScheme: byEnvVar
versionEnvVar: NuGetVersion
packDestination: $(Build.ArtifactStagingDirectory)/package
arguments: "-o $(Build.ArtifactStagingDirectory)/package"
projects: |
**/*.csproj
- task: PublishBuildArtifacts@1
displayName: Publish Build Artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: Deploy
displayName: Deploy
jobs:
- job: Deploy
condition:
or(
in(variables['Build.SourceBranch'], 'refs/heads/main'),
in(variables['Build.Reason'], 'Manual')
)
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
itemPattern:
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: Publish package to nuget.org using ASOS organisation account
inputs:
command: 'push'
packagesToPush: '$(System.ArtifactsDirectory)/drop/*.nupkg;!$(System.ArtifactsDirectory)/drop/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'ASOS nuget.org feed'