-
Notifications
You must be signed in to change notification settings - Fork 28
/
azure-pipelines-5.yml
98 lines (82 loc) · 2.29 KB
/
azure-pipelines-5.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
resources:
containers:
- container: redis5
image: redis:5
- container: redis4
image: redis:4
jobs:
- job: BuildAndTest
displayName: Build and Test
strategy:
matrix:
DotNetCore22:
containerImage: mcr.microsoft.com/dotnet/core/sdk:2.2
DotNetCore22Nightly:
containerImage: mcr.microsoft.com/dotnet/core-nightly/sdk:2.2
pool:
vmImage: 'ubuntu-16.04'
container: $[ variables['containerImage'] ]
services:
redis5: redis5
redis4: redis4
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration release'
- task: DotNetCoreCLI@2
displayName: Test with Redis v5
inputs:
command: test
projects: '**/*Tests.csproj'
arguments: '--configuration release'
testRunTitle: MyProject - Redis v5 - $(Agent.JobName)
env:
CONNECTIONSTRINGS_REDIS: redis5:6379
continueOnError: true
- task: DotNetCoreCLI@2
displayName: Test with Redis v4
inputs:
command: test
projects: '**/*Tests.csproj'
arguments: '--configuration release'
testRunTitle: MyProject - Redis v4 - $(Agent.JobName)
env:
CONNECTIONSTRINGS_REDIS: redis4:6379
continueOnError: true
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
projects: 'MyProject/MyProject.csproj'
publishWebProjects: false
zipAfterPublish: false
arguments: '--configuration release'
- task: PublishPipelineArtifact@0
displayName: Store artefact
inputs:
artifactName: 'MyProject'
targetPath: 'MyProject/bin/release/netcoreapp2.2/publish/'
condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'DotNetCore22'))
- job: Package
dependsOn: BuildAndTest
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@1
inputs:
artifactName: 'MyProject'
targetPath: '$(System.DefaultWorkingDirectory)'
- task: Docker@2
displayName: Docker build and Push
inputs:
command: buildAndPush
containerRegistry: 'MyACR'
repository: myproject
tags: $(Build.BuildNumber)