forked from DFE-Digital/academies-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
91 lines (75 loc) · 2.36 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
83
84
85
86
87
88
89
90
91
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- main
pr: none
pool:
vmImage: 'ubuntu-18.04'
variables:
dotnetSdkVersion: '3.1.300'
buildPlatform: 'Any CPU'
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core SDK $(dotnetSdkVersion)'
inputs:
version: '$(dotnetSdkVersion)'
- task: DotNetCoreCLI@2
displayName: 'New manifest for tool'
inputs:
command: custom
custom: 'new'
arguments: tool-manifest
- task: DotNetCoreCLI@2
displayName: 'Install EF Tool'
inputs:
command: custom
custom: 'tool'
arguments: install dotnet-ef
- task: Npm@1
inputs:
command: 'install'
workingDir: 'CypressTests'
- task: DotNetCoreCLI@2
displayName: 'Restore project dependencies'
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build the test project'
inputs:
command: 'build'
arguments: '--no-restore'
projects: 'TramsDataApi.Test/*.csproj'
- script: |
docker login ghcr.io -u $(github_user) -p $(github_pass)
docker run -d -p 1433:1433 ghcr.io/dfe-digital/trams-development-database:latest
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: 'test'
publishTestResults: true
projects: '**/*.Test.csproj'
- task: DotNetCoreCLI@2
displayName: 'Create SQL Scripts'
inputs:
command: custom
custom: 'ef '
arguments: migrations script --output $(Build.SourcesDirectory)/SQL/tramsDbMigrationScript.sql --idempotent -p TramsDataApi -c TramsDbContext
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: SQLScripts'
inputs:
PathtoPublish: $(Build.SourcesDirectory)/SQL/tramsDbMigrationScript.sql
ArtifactName: SQLScripts
- task: DotNetCoreCLI@2
displayName: 'Publish Project'
inputs:
command: publish
arguments: '--output $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: TramsAPIBuild'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'tramsApiBuild'
publishLocation: 'Container'