This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
azure-pipelines.yml
87 lines (77 loc) · 2.65 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
# ASP.NET CI/CD for the Modern Workplace Concierge Project
trigger:
- master
pr: none
name: $(date:yyyy).$(date:MM).$(date:dd)$(Rev:.r)
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
artifactName: 'drop'
azureSubscription: 'AzureServiceConnection'
webAppName: 'mwconcierge'
resourceGroupName: 'intuneconcierge'
deploymentTime: ''
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VersionAssemblies@2
inputs:
Path: '$(Build.SourcesDirectory)'
VersionNumber: '$(Build.BuildNumber)'
InjectVersion: False
FilenamePattern: 'AssemblyInfo.*'
OutputVersion: 'OutputedVersion'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(artifactName)'
publishLocation: 'Container'
- stage: Deploy
jobs:
- job: Deploy
steps:
- checkout: none
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '$(artifactName)'
downloadPath: '$(System.ArtifactsDirectory)'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$date=$(Get-Date -Format o);
Write-Host "##vso[task.setvariable variable=deploymentTime]$date"
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(azureSubscription)'
ResourceGroupName: '$(resourceGroupName)'
appType: 'webApp'
WebAppName: '$(webAppName)'
deployToSlotOrASE: true
packageForLinux: '$(System.ArtifactsDirectory)\**\*.zip'
AppSettings: '-CommitID $(Build.SourceVersion) -Repository $(BUILD.REPOSITORY.NAME) -Branch $(BUILD.SOURCEBRANCHNAME) -DeploymentTime "$(deploymentTime)"'
enableCustomDeployment: true
TakeAppOfflineFlag: false
RemoveAdditionalFilesFlag: true