-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
82 lines (72 loc) · 2.65 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
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- main
pool:
vmImage: 'windows-latest'
#vmImage: ubuntu-latest
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
dotNetFramework: 'net7.0'
dotNetVersion: '7.0.x'
#targetRuntime: 'linux-x64'
dockerRegistryServiceConnection: 'videostoreregistry' # using service principal created for docker registry
identityServiceImageRepository: 'identity'
identityServiceDockerfilePath: '$(Build.SourcesDirectory)/src/services/identity/VideoStore.IdentityService/Dockerfile'
tag: '$(Build.BuildId)'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 7 sdk'
inputs:
packageType: 'sdk'
version: '7.x'
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Runt tests
inputs:
command: test
projects: '**/Tests/*.csproj'
arguments: '--configuration $(buildConfiguration)'
# - script: dotnet build --configuration $(buildConfiguration)
# displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Build solution
inputs:
command: 'build'
projects: '**/*.sln'
arguments: '--configuration $(buildConfiguration)'
# Publish it as .NET 7 application for windows runtime
- task: DotNetCoreCLI@2
displayName: 'Publish artifacts'
inputs:
command: publish
publishWebProjects: true # If the publishWebProjects is true, the 'projects' property value is skipped
#projects: 'src/services/*/*/*.csproj'
arguments: '--configuration $(BuildConfiguration) --framework $(dotNetFramework) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
# Publish it as .NET 7 self-contained application for linux runtime
# - task: DotNetCoreCLI@2
# inputs:
# command: publish
# publishWebProjects: True
# arguments: '--configuration $(BuildConfiguration) --framework $(dotNetFramework) --runtime $(targetRuntime) --self-contained true --output $(Build.ArtifactStagingDirectory)'
# zipAfterPublish: True
# Package the file and uploads them as an artifact of the build -> new way
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'VideoStoreArtifact'
publishLocation: 'pipeline'
# - task: Docker@2
# inputs:
# containerRegistry: $(dockerRegistryServiceConnection)
# repository: $(identityServiceImageRepository)
# command: 'buildAndPush'
# Dockerfile: $(identityServiceDockerfilePath)
# buildContext: '$(Build.SourcesDirectory)/src'
# tags: |
# $(tag)