-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines-signalr.yaml
88 lines (77 loc) · 2.57 KB
/
azure-pipelines-signalr.yaml
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
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- develop
pool:
vmImage: 'ubuntu-latest'
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '2b3a0bb4-f60b-4ca6-a178-b5ac8f365578'
imageRepository: 'signalrfunctions'
containerRegistry: 'mydemos.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/Serverless/SignalR/Dockerfile'
tag: '$(Build.BuildId)'
buildConfiguration: 'Release'
vmImageName: 'ubuntu-latest'
stages:
- stage: BuildArtifact
displayName: Build function artifact
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: UseDotNet@2
displayName: ".NET Core 3.1.x"
inputs:
version: '3.1.x'
packageType: sdk
- script: dotnet build Serverless/SignalR/SignalR-functions.csproj --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: "Test"
inputs:
command: test
projects: '**/*tests/*.csproj'
arguments: '--configuration $(buildConfiguration)'
#- task: UseDotNet@2
# displayName: ".NET Core 3.1.x"
# inputs:
# version: '3.1.x'
# packageType: sdk
#- script: dotnet publish Serverless/SignalR/SignalR-functions.csproj -r linux-x64 --output $(Build.ArtifactStagingDirectory)' --configuration $(buildConfiguration)
# displayName: 'dotnet build $(buildConfiguration)'
#- task: DotNetCoreCLI@2
# displayName: "Publish"
# inputs:
# command: 'publish'
# projects: '**/SignalR-functions.csproj'
# arguments: '-r linux-x64 --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
# zipAfterPublish: true
# workingDirectory: 'Serverless/SignalR'
- task: PublishBuildArtifacts@1
displayName: "Upload Artifacts"
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'signalr-functions'
- stage: BuildDocker
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)