diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..a37410968 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,86 @@ +# 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: +- main + +variables: + # Azure Resource Manager connection created during pipeline creation + azureServiceConnectionId: 'ecc9f15d-a049-4bbd-953a-9becee6430b2' + + # Web app name + webAppName: 'test40me' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + + # Environment name + environmentName: 'test40me' + + # Project root folder. Point to the folder containing manage.py file. + projectRoot: $(System.DefaultWorkingDirectory) + + pythonVersion: '3.11' + +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 : test40me' + inputs: + azureSubscription: $(azureServiceConnectionId) + appName: $(webAppName) + package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip \ No newline at end of file diff --git a/hello_app/templates/about.html b/hello_app/templates/about.html index 8611b6414..3e975cf58 100644 --- a/hello_app/templates/about.html +++ b/hello_app/templates/about.html @@ -3,5 +3,5 @@ About us {% endblock %} {% block content %} -

About page for the Visual Studio Code Flask tutorial.

+

Keep pushing for consistency super charge

{% endblock %} diff --git a/hello_app/templates/home.html b/hello_app/templates/home.html index 95609fecd..3ab677ceb 100644 --- a/hello_app/templates/home.html +++ b/hello_app/templates/home.html @@ -3,5 +3,5 @@ Home {% endblock %} {% block content %} -

Home page for the Visual Studio Code Flask tutorial.

+

Home page for the Visual Studio Code Flask tutorials.

{% endblock %}