blob: 8f0ee9920b0aee8d1550c4aa1e54650349329ab1 (
plain)
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
|
trigger:
- master
- dev
stages:
- stage: build
displayName: Routine Build and Test
jobs:
- job: frontend_build
displayName: Frontend Build
pool:
vmImage: 'ubuntu-18.04'
steps:
- script: yarn
workingDirectory: Timeline/ClientApp
displayName: Restore Packages
- script: yarn build
workingDirectory: Timeline/ClientApp
displayName: Webpack Build
- publish: Timeline/ClientApp/dist
artifact: timeline-frontend
- job: backend_build
displayName: Backend Build Debug and Test
pool:
vmImage: 'ubuntu-18.04'
variables:
buildConfiguration: 'Debug'
ASPNETCORE_ENVIRONMENT: 'Development'
steps:
- task: UseDotNet@2
inputs:
packageType: sdk
version: 3.1.x
- script: |
dotnet restore Timeline/Timeline.csproj --configfile nuget.config
dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config
displayName: Dotnet Restore
- script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings'
displayName: Dotnet Test
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '**/TestResults/*/coverage.cobertura.xml'
- stage: deploy
displayName: Build Release and Deploy
dependsOn: build
condition: eq(variables['Build.SourceBranchName'], 'master')
variables:
buildConfiguration: 'Release'
jobs:
- job: build
displayName: Build Release Artifact
pool:
vmImage: 'ubuntu-18.04'
steps:
- task: UseDotNet@2
inputs:
packageType: sdk
version: 3.1.x
- script: dotnet publish Timeline/Timeline.csproj --configuration $(buildConfiguration) --output ./Timeline/publish/ -r linux-x64 --self-contained false
displayName: Dotnet Publish
- publish: Timeline/publish
artifact: timeline
- task: Docker@2
displayName: Build And Push Docker Image
inputs:
command: buildAndPush
repository: crupest/timeline
tags: latest
buildContext: Timeline
containerRegistry: crupest-docker-hub
|