/
azure-pipelines-pr.yaml
50 lines (45 loc) · 1.43 KB
/
azure-pipelines-pr.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
# 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: none
pr:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
System_AccessToken: $(System.AccessToken)
stages:
- stage: 'BuildTest'
displayName: 'Build'
jobs:
- job: 'BuildTestPublish'
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: 'build'
projects: '**/*.csproj'
- task: UseDotNet@2
inputs:
version: '3.1.200'
- task: DotNetCoreCLI@2
displayName: 'Initialize EntityFrameworkCore'
inputs:
command: custom
custom: tool
arguments: 'install --global dotnet-ef'
- task: DotNetCoreCLI@2
displayName: 'Create migration'
inputs:
command: custom
custom: ef
arguments: 'migrations script --project DatabasePerTenant.Data.Catalog/ --startup-project DatabasePerTenant.Data.MigrationApp --context CatalogDbContext -i -o $(Build.ArtifactStagingDirectory)/sql/migration.sql'
workingDirectory: $(Build.SourcesDirectory)