This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
71 lines (65 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
- develop
pr:
- master
- develop
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-latest'
Windows:
osName: 'Windows'
imageName: 'windows-latest'
Mac:
osName: 'macOS'
imageName: 'macOS-latest'
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
DOTNET_CLI_TELEMETRY_OPTOUT: 1
'Lidarr:Database': 'server=localhost;user id=root;password=root; database=lidarrupdate;CharSet=utf8mb4'
'Lidarr:DataDirectory': $(Build.SourcesDirectory)
steps:
- task: UseDotNet@2
displayName: 'Install .net core 3.1'
inputs:
version: '3.1.102'
condition: ne(variables['osName'], 'Windows')
- task: SonarCloudPrepare@1
displayName: 'Prepare SonarCloud'
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
inputs:
SonarCloud: 'SonarCloud'
organization: 'lidarr'
scannerMode: 'MSBuild'
projectKey: 'lidarr_LidarrAPI.Update'
projectName: 'LidarrAPI.Update'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
arguments: '-c Release'
projects: 'src/LidarrAPI.sln'
- task: SonarCloudAnalyze@1
displayName: 'SonarCloud Analysis'
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- task: SonarCloudPublish@1
displayName: 'Publish SonarCloud to Azure'
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
inputs:
pollingTimeoutSec: '300'
- powershell: |
dotnet tool install --global dotnet-ef
dotnet ef database update --project src/LidarrAPI/LidarrAPI.csproj --startup-project src/LidarrAPI/LidarrAPI.csproj
displayName: 'Test Database Migrations'
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
- publish: ./src/LidarrAPI/bin/Release
artifact: '$(imageName) Package'
displayName: Publish Packages