-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
70 lines (57 loc) · 2.02 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
# Starter pipeline Start with a minimal pipeline that you can customize to build and deploy your code. Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- Main
- pipeline-fix
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
displayName: 'Build and Test'
jobs:
- job: Build
displayName: 'Build the Project'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '8.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
# Restore Dependencie
- script: dotnet restore
displayName: 'Restore Dependencies'
# Build in Release Mode
- script: dotnet build --configuration Release --no-restore
displayName: 'Build the project'
- script: dotnet publish --configuration Release -o '$(Pipeline.Workspace)'
displayName: 'Publish .NET Application'
# Run unit tests
- script: dotnet test --configuration Release --no-build --verbosity normal
displayName: 'Run tests'
# Publish build artificats
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifact: 'drop'
publishLocation: 'pipeline'
- stage: Deploy_Dev
displayName: 'Deploy to Development'
dependsOn: Build
condition: succeeded()
jobs:
- job: DeployDev
displayName: 'Deploy to Azure App Service'
pool:
vmImage: 'ubuntu-latest'
steps:
- download: current
artifact: drop
# Deploy to azure app service
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy to Azure App Service'
inputs:
azureSubscription: 'AzureServiceConnection'
WebAppName: 'doorstep-donuts-dev'
packageForLinux : '$(Pipeline.Workspace)/drop'