-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
72 lines (67 loc) · 2.42 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
# 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
- dev
pool:
vmImage: ubuntu-latest
stages:
- stage: Main
displayName: "Main branch"
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: MainJob
displayName: "Main branch job"
steps:
- task: UseDotNet@2
inputs:
version: "6.0.x"
packageType: sdk
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: "--configuration Release --output publish_output"
projects: "**/az-function.csproj"
publishWebProjects: false
modifyOutputPath: false
zipAfterPublish: false
- task: ArchiveFiles@2
displayName: "Archive files"
inputs:
rootFolderOrFile: "$(System.DefaultWorkingDirectory)/publish_output"
includeRootFolder: false
archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
artifactName: "drop"
- task: AzureFunctionApp@1 # Add this at the end of your file
inputs:
azureSubscription: "MyServiceConnection"
appType: functionAppLinux # default is functionApp
appName: "fnapp-y3ac2abjvi3wq"
package: $(System.DefaultWorkingDirectory)/**/*.zip
runtimeStack: "DOTNET|6.0"
- stage: Development
displayName: "Development branch"
condition: ne(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: DevJob
displayName: "Development branch job"
steps:
- task: DotNetCoreCLI@2
inputs:
command: "restore"
projects: "**/az-function.csproj"
- task: DotNetCoreCLI@2
inputs:
command: "build"
projects: "**/az-function.csproj"
arguments: "--configuration Release"
- task: DotNetCoreCLI@2
inputs:
command: "test"
projects: "**/az-function-tests.csproj"
arguments: "--configuration Release"