-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
79 lines (76 loc) · 2.61 KB
/
azure-pipelines.yml
File metadata and controls
79 lines (76 loc) · 2.61 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
72
73
74
75
76
77
78
79
trigger:
- master
variables:
# Azure Resource Manager connection (specified in ADO variables)
# azureSubscription: 'myAzureConnection'
# Function app name (specified in ADO variables)
# functionAppName: 'myAzure-azfn'
# Agent VM image name (specified in ADO variables)
# vmImageName: 'ubuntu-latest'
# Working Directory
workingDirectory: '$(System.DefaultWorkingDirectory)/__app__'
# Python Version
pythonVersion: 3.7
stages:
- stage: Package
displayName: Package stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(workingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'
- stage: Deploy
displayName: Deploy stage
dependsOn: Package
condition: succeeded()
jobs:
- deployment: Deploy
displayName: Deploy
environment: 'development'
pool:
vmImage: $(vmImageName)
strategy:
runOnce:
deploy:
steps:
- task: FuncToolsInstaller@0
inputs:
version: 'latest'
- task: Bash@3
displayName: 'Allow gozip to execute in non windows environments #1899'
condition: ne(variables['Agent.OS'], 'Windows_NT')
env:
toolsDir: $(Agent.ToolsDirectory)
architecture: $(Agent.OSArchitecture)
inputs:
targetType: 'inline'
script: |
funcVersion=$(func --version)
funcToolsPath="${toolsDir}/func/${funcVersion}/${architecture,,}/"
echo "Making executable the following file: ${funcToolsPath}gozip"
chmod +x "${funcToolsPath}gozip"
- download: current
displayName: 'Download packaged artifacts'
artifact: drop
#- task: AzureCLI@2
# displayName: 'Verify that we can read existing deployed functions'
# inputs:
# azureSubscription: $(azureSubscription)
# scriptType: 'pscore'
# scriptLocation: 'inlineScript'
# inlineScript: 'func azure functionapp list-functions $(functionAppName)'
# workingDirectory: '$(Pipeline.Workspace)/drop/'
- task: AzureCLI@2
displayName: 'Deploy new version of codebase'
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: 'func azure functionapp publish $(functionAppName) --python'
workingDirectory: '$(Pipeline.Workspace)/drop/'