-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-v2.yml
72 lines (62 loc) · 1.89 KB
/
azure-pipelines-v2.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
trigger:
- '*'
variables:
buildConfiguration: 'Release'
stages:
- stage: 'Build'
displayName: 'Build Baseball Web/API apps'
jobs:
- job: 'Build'
displayName: 'Build job'
pool:
vmImage: 'ubuntu-20.04'
variables:
dotnetSdkVersion: '6.0.400'
steps:
- task: UseDotNet@2
displayName: 'Use .NET SDK $(dotnetSdkVersion)'
inputs:
version: '$(dotnetSdkVersion)'
- script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt'
displayName: 'Write build info'
- task: DotNetCoreCLI@2
displayName: 'Restore project dependencies'
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build the project - $(buildConfiguration)'
inputs:
command: 'build'
arguments: '--no-restore --configuration $(buildConfiguration)'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Publish the project - $(buildConfiguration)'
inputs:
command: 'publish'
projects: '**Mvc/*.csproj'
publishWebProjects: false
arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)'
zipAfterPublish: true
- publish: '$(Build.ArtifactStagingDirectory)'
artifact: drop
- stage: 'Deploy'
displayName: 'Deploy Baseball Web/API apps'
dependsOn: Build
jobs:
- deployment: Deploy
pool:
vmImage: 'ubuntu-20.04'
environment: dev
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- task: AzureWebApp@1
inputs:
azureSubscription: 'BBWeb-ServiceConnection1'
appType: webApp
appName: 'BBWebDemoApp1'
package: '$(Pipeline.Workspace)/drop/Release/*.zip'