-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathazure-devops-pipelines-app-service-code.yml
More file actions
72 lines (59 loc) · 2.47 KB
/
azure-devops-pipelines-app-service-code.yml
File metadata and controls
72 lines (59 loc) · 2.47 KB
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
# To use this file, you need to configure Pipelines settings in Azure DevOps portal.
# URL: https://dev.azure.com/aaronamm/
# Official document
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
# GitHub trigger https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#ci-triggers
trigger:
- develop
pool:
vmImage: ubuntu-latest
variables:
# Use predefined variables https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
# Pipeline.Workspace != Build.SourcesDirectory
webProjectPath: $(Build.SourcesDirectory)/CoreMvcAppService/CoreMvcAppService.csproj # Set this to the path to your web app project.
dotnetVersion: 5.0.x # Set this to the dot net version to use.
buildConfiguration: Release
steps:
- task: CmdLine@2
inputs:
script: |
pwd
ls
displayName: logging directory information
- task: UseDotNet@2
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true # To install a newer SDK
includePreviewVersions: true # Required for preview versions
displayName: install .NET version $(dotnetVersion)
- task: DotNetCoreCLI@2
inputs:
command: restore
feedsToUse: select # Select a feed from NuGet
# workingDirectory" seems to be ignored for DotNetCoreCLI@2 https://github.com/microsoft/azure-pipelines-tasks/issues/10996
# Use projects instead https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/DotNetCoreCLIV2#parameters-of-the-task
projects: $(webProjectPath)
displayName: dotnet restore in $(webProjectPath)
- task: DotNetCoreCLI@2
inputs:
command: build
arguments: --configuration $(buildConfiguration)
projects: $(webProjectPath)
displayName: dotnet build --configuration $(buildConfiguration)
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: --configuration $(BuildConfiguration) --output $(Build.SourcesDirectory)/publish
publishWebProjects: True
zipAfterPublish: True
displayName: dotnet publish --configuration $(BuildConfiguration) --output $(Build.SourcesDirectory)/publish
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/publish
artifactName: artifect
# TODO add publishing to Azure Devops Feed and release version number
- task: AzureWebApp@1
inputs:
azureSubscription: codesanook-examples-service-connection
appName: cs-core-mvc-pipelines
package: $(Build.SourcesDirectory)/publish/**/*.zip