-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
85 lines (72 loc) · 2.34 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
# ASP.NET Core:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
# Docker Compose:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/docker-compose
# YAML reference:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema
trigger:
branches:
include:
- master
pool:
vmImage: 'ubuntu-latest'
resources:
- repo: self
variables:
buildConfiguration: 'Release'
restoreBuildProjectFunction: '**/IoT.Function.Trigger.csproj'
restoreBuildProjectFunctionTest: '**/IoT.Function.Trigger.*[Tt]ests/*.csproj'
azureSubscriptionEndpoint: unb-azure-resource
azureContainerRegistry: rfidregistry.azurecr.io
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '$(restoreBuildProjectFunction)'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '$(restoreBuildProjectFunction)'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '$(restoreBuildProjectFunctionTest)'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
projects: '$(restoreBuildProjectFunction)'
publishWebProjects: false
modifyOutputPath: true
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
- task: DockerCompose@0
displayName: Build services
inputs:
action: Build services
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureContainerRegistry: $(azureContainerRegistry)
dockerComposeFile: '**/docker-compose.yml'
projectName: $(Build.Repository.Name)
qualifyImageNames: true
includeLatestTag: true
additionalImageTags: $(Build.BuildId)
- task: DockerCompose@0
displayName: Push services
inputs:
action: Push services
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureContainerRegistry: $(azureContainerRegistry)
dockerComposeFile: '**/docker-compose.yml'
projectName: $(Build.Repository.Name)
qualifyImageNames: true
includeLatestTag: true
additionalImageTags: $(Build.BuildId)