forked from microsoft/python-sample-vscode-flask-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
54 lines (44 loc) · 1.53 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
54 lines (44 loc) · 1.53 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
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
variables:
ConnectedServiceName: 'flask pipeline'
WebAppName: 'zqcflask'
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
displayName: 'Use Python 3.6'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install dependencies'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip'
replaceExistingArchive: true
verbose: # (no value); this input is optional
- task: AzureRMWebAppDeployment@4
displayName: Azure App Service Deploy
inputs:
appType: webAppLinux
RuntimeStack: 'PYTHON|3.6'
ConnectedServiceName: $(ConnectedServiceName)
WebAppName: $(WebAppName)
Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip'
# The following parameter is specific to the Flask example code. You may
# or may not need a startup command for your app.
StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app'
# - script: |
# pip install pytest pytest-azurepipelines
# pytest
# displayName: 'pytest'