-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment_pipeline.yml
41 lines (41 loc) · 1.2 KB
/
deployment_pipeline.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
stages:
- stage: Deployment
jobs:
- job:
displayName: Deployment Job
pool:
vmImage: 'ubuntu-16.04'
steps:
# SET PYTHON VERSION
- task: UsePythonVersion@0
displayName: "Setting Required Python Version for Azure Functions"
inputs:
versionSpec: '3.6'
architecture: 'x64'
# INIT CONDA ENVIRONMENT
- bash: |
python3.6 -m venv worker_venv
source worker_venv/bin/activate
pip3.6 install setuptools
pip3.6 install -r requirements.txt
displayName: Install Dependencies
# UNIT TESTING
- bash: |
source worker_venv/bin/activate
pytest
displayName: Run Unit Tests
# BUNDLE FUNCTION
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(System.DefaultWorkingDirectory)/output.zip'
replaceExistingArchive: true
# DEPLOY FUNCTION
- task: AzureFunctionApp@1
inputs:
azureSubscription: '$(fx.azureSubscription)'
appType: 'functionAppLinux'
appName: '$(fx.name)'
package: '$(System.DefaultWorkingDirectory)/output.zip'