-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
71 lines (68 loc) · 2 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
trigger:
- deployment
pool:
vmImage: 'ubuntu-latest'
variables:
projects: '**/*.sln'
buildConfiguration: 'debug'
steps:
- task: DownloadSecureFile@1
name: envFile
displayName: 'Download .env file'
inputs:
secureFile: 'test.env'
- task: DockerCompose@0
displayName: Start dependencies (docker-compose)
inputs:
containerregistrytype: Container Registry
dockerComposeFile: '**/docker-compose.yml'
dockerComposeCommand: '--env-file=$(envFile.secureFilePath) up -d'
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 6.x'
inputs:
packageType: sdk
version: 6.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: Restore nuget packages
inputs:
command: restore
feedsToUse: 'select'
projects: $(projects)
workingDirectory: $(System.DefaultWorkingDirectory)
- task: DotNetCoreCLI@2
displayName: 'Build application'
inputs:
command: build
projects: $(projects)
arguments: '--configuration $(buildConfiguration) --no-restore'
workingDirectory: $(System.DefaultWorkingDirectory)
- task: DotNetCoreCLI@2
displayName: 'Test application'
inputs:
command: test
projects: $(projects)
arguments: '--configuration $(buildConfiguration)'
workingDirectory: $(System.DefaultWorkingDirectory)
- task: DotNetCoreCLI@2
displayName: 'Publish application'
inputs:
command: publish
nobuild: true
projects: $(projects)
arguments: '--output $(Build.ArtifactStagingDirectory)/output'
publishWebProjects: false
zipAfterPublish: true
modifyOutputPath: true
workingDirectory: $(System.DefaultWorkingDirectory)
- task: CopyFiles@2
displayName: 'Prepare docker'
inputs:
contents: '$(System.DefaultWorkingDirectory)/devops/**'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishPipelineArtifact@1
displayName: 'Publish pipeline artifact'
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'publish-$(buildConfiguration)'
publishLocation: 'pipeline'