forked from aranasoft/learn-azureDevOps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
101 lines (96 loc) · 2.93 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
92
93
94
95
96
97
98
99
100
101
# 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:
batch: false
branches:
include:
- "*"
pr:
branches:
include:
- "*"
schedules:
- cron: 0 23 * * *
always: true
branches:
include:
- "master"
displayName: "1am EET UTC+2"
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: BuildStage
displayName: 'Build Stage'
jobs:
- job: BuildJob
displayName: 'Build Job'
timeoutInMinutes: 5
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
timeoutInMinutes: 3
inputs:
command: 'build'
arguments: '--no-restore --configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: 'test'
projects: '*.tests/*.tests.csproj'
arguments: '--no-restore --no-build --configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--no-restore --no-build --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'webApp'
publishLocation: 'Container'
- stage: TestDeployStage
condition: "and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))"
displayName: 'Test Deployment'
jobs:
- deployment: Deploy
displayName: 'Deployment'
environment: 'azureDevOpsWorkshop-dev'
strategy:
runOnce:
deploy:
steps:
- task: AzureRmWebAppDeployment@4
displayName: 'Azure App Service Deploy'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Arana Software (b8ba1017-db20-40ed-bf4b-ed8d50d50175)'
appType: 'webApp'
WebAppName: 'workshop-dev'
packageForLinux: '$(Pipeline.Workspace)/webApp/learn-azuredevops.zip'
- stage: ProdDeployStage
displayName: 'Production Deployment'
condition: "and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))"
jobs:
- deployment: Deploy
displayName: 'Deployment'
environment: 'azureDevOpsWorkshop-prod'
strategy:
runOnce:
deploy:
steps:
- task: AzureRmWebAppDeployment@4
displayName: 'Azure App Service Deploy'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Arana Software (b8ba1017-db20-40ed-bf4b-ed8d50d50175)'
appType: 'webApp'
WebAppName: 'workshop-prod'
packageForLinux: '$(Pipeline.Workspace)/webApp/learn-azuredevops.zip'