-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
46 lines (42 loc) · 1.06 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
trigger:
- main
resources:
- repo: self
variables:
dockerRegistryServiceConnection: '5d05a2ef-c74a-47da-898a-9520334170cb'
imageRepository: 'exrate'
containerRegistry: 'exrate.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
tag: '$(Build.BuildId)'
vmImage: 'ubuntu-latest'
stages:
- stage: Test_Stage
displayName: Test Stage
jobs:
- job: Test
displayName: Test
pool:
vmImage: $(vmImage)
steps:
- task: DotNetCoreCLI@2
displayName: Run .NET Tests
inputs:
command: 'test'
projects: '**/*Tests.csproj'
- stage: Build_Docker_Image_Stage
displayName: Docker build and push stage
jobs:
- job: Docker_Build
displayName: Docker build and push
pool:
vmImage: $(vmImage)
steps:
- task: Docker@2
displayName: Docker Build and push image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)