diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..68b0f3fb2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,49 @@ +variables: + ConnectedServiceName: 'Azure Primary' + WebAppName: 'taniawebsite-flaskpipelines' + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.6' + architecture: 'x64' + +- script: | + # venv3.6 is the virtual environment name that App Service expects with + # Python 3.6; use "venv" for Python 3.7. + python3.6 -m venv antenv3.6 + source antenv3.6/bin/activate + pip3.6 install setuptools + pip3.6 install -r requirements.txt + + # The displayName is shown in the pipeline UI when a build runs + displayName: 'Install Dependencies' + +- task: ArchiveFiles@2 + inputs: + rootFolderOrFile: '$(Build.SourcesDirectory)' + includeRootFolder: false + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' + replaceExistingArchive: true + verbose: #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 own app. + + StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app'