From 4d774bfce3f99d244fa067567cf62280c4cbf68b Mon Sep 17 00:00:00 2001 From: Kossisochukwu Okafor Date: Thu, 10 Mar 2022 04:24:56 +0000 Subject: [PATCH 1/3] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..55eda2d9c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,88 @@ +# Python to Linux Web App on Azure +# Build your Python project and deploy it to Azure as a Linux Web App. +# Change python version to one thats appropriate for your application. +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +variables: + # Azure Resource Manager connection created during pipeline creation + azureServiceConnectionId: '70c5b264-4aa8-4dcc-983f-dc6f6b9528d6' + + # Web app name + webAppName: 'my-kossy-python-app' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + + # Environment name + environmentName: 'my-kossy-python-app' + + # Project root folder. Point to the folder containing manage.py file. + projectRoot: $(System.DefaultWorkingDirectory) + + # Python version: 3.7 + pythonVersion: '3.7' + +stages: +- stage: Build + displayName: Build stage + jobs: + - job: BuildJob + pool: + vmImage: $(vmImageName) + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(pythonVersion)' + displayName: 'Use Python $(pythonVersion)' + + - script: | + python -m venv antenv + source antenv/bin/activate + python -m pip install --upgrade pip + pip install setup + pip install -r requirements.txt + workingDirectory: $(projectRoot) + displayName: "Install requirements" + + - task: ArchiveFiles@2 + displayName: 'Archive files' + inputs: + rootFolderOrFile: '$(projectRoot)' + includeRootFolder: false + archiveType: zip + archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + replaceExistingArchive: true + + - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + displayName: 'Upload package' + artifact: drop + +- stage: Deploy + displayName: 'Deploy Web App' + dependsOn: Build + condition: succeeded() + jobs: + - deployment: DeploymentJob + pool: + vmImage: $(vmImageName) + environment: $(environmentName) + strategy: + runOnce: + deploy: + steps: + + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(pythonVersion)' + displayName: 'Use Python version' + + - task: AzureWebApp@1 + displayName: 'Deploy Azure Web App : my-kossy-python-app' + inputs: + azureSubscription: $(azureServiceConnectionId) + appName: $(webAppName) + package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip + \ No newline at end of file From 8241e3029f7ba3370e51aca7b22cdce4ab2866d1 Mon Sep 17 00:00:00 2001 From: kossytony Date: Wed, 9 Mar 2022 23:28:02 -0500 Subject: [PATCH 2/3] Update azure pipeline file --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55eda2d9c..d6ab4142c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,4 +85,5 @@ stages: azureSubscription: $(azureServiceConnectionId) appName: $(webAppName) package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip + StartupCommand: 'startup.txt' \ No newline at end of file From 1503da1da67b92d35b6d85ac08e4cc46325650c8 Mon Sep 17 00:00:00 2001 From: kossytony Date: Wed, 9 Mar 2022 23:36:12 -0500 Subject: [PATCH 3/3] added stuff to the contact page --- hello_app/templates/contact.html | 1 + 1 file changed, 1 insertion(+) diff --git a/hello_app/templates/contact.html b/hello_app/templates/contact.html index 3321c9454..4d48e5f7f 100644 --- a/hello_app/templates/contact.html +++ b/hello_app/templates/contact.html @@ -4,4 +4,5 @@ {% endblock %} {% block content %}

Contact page for the Visual Studio Code Flask tutorial.

+

My first end file

{% endblock %}