From afd2c7deb6feb2de28d806a27219f9d92fd33775 Mon Sep 17 00:00:00 2001 From: Vincent de Beet Date: Tue, 19 Nov 2019 12:28:29 +0100 Subject: [PATCH 1/5] Deployed App --- .deployment | 2 ++ .vscode/settings.json | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .deployment diff --git a/.deployment b/.deployment new file mode 100644 index 000000000..627833181 --- /dev/null +++ b/.deployment @@ -0,0 +1,2 @@ +[config] +SCM_DO_BUILD_DURING_DEPLOYMENT=true \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index b035bb43d..f8f3ccb85 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,34 @@ { - "python.pythonPath": "${workspaceFolder}\\env\\Scripts\\python.exe" + "python.pythonPath": ".env/bin/python", + "appService.zipIgnorePattern": [ + "__pycache__{,/**}", + "*.py[cod]", + "*$py.class", + ".Python{,/**}", + "build{,/**}", + "develop-eggs{,/**}", + "dist{,/**}", + "downloads{,/**}", + "eggs{,/**}", + ".eggs{,/**}", + "lib{,/**}", + "lib64{,/**}", + "parts{,/**}", + "sdist{,/**}", + "var{,/**}", + "wheels{,/**}", + "share/python-wheels{,/**}", + "*.egg-info{,/**}", + ".installed.cfg", + "*.egg", + "MANIFEST", + ".env{,/**}", + ".venv{,/**}", + "env{,/**}", + "venv{,/**}", + "ENV{,/**}", + "env.bak{,/**}", + "venv.bak{,/**}", + ".vscode{,/**}" + ] } \ No newline at end of file From c1b2bec63358c14f5e62d052df00784d2dbec382 Mon Sep 17 00:00:00 2001 From: VinGit67 <33829262+VinGit67@users.noreply.github.com> Date: Tue, 19 Nov 2019 13:03:32 +0100 Subject: [PATCH 2/5] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..aa912913d --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' + +- script: | + echo Add other tasks to build, test, and deploy your project. + echo See https://aka.ms/yaml + displayName: 'Run a multi-line script' From 4b9890bb9603702a0b1840831144fdda7730783e Mon Sep 17 00:00:00 2001 From: VinGit67 <33829262+VinGit67@users.noreply.github.com> Date: Tue, 19 Nov 2019 13:07:09 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d07d6d8ed..5a291802b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Python/Flask tutorial sample for Visual Studio Code +# Python/Flask tutorial sample for Visual Studio Code Forked * This sample contains the completed program from the tutorial, make sure to visit the link: [Using Flask in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-flask). Intermediate steps are not included. * It also contains the Dockerfile and uwsgi.ini files necessary to build a container with a production server. The resulting image works both locally and when deployed to Azure App Service. See [Deploy Python using Docker containers](https://code.visualstudio.com/docs/python/tutorial-deploy-containers). From 34667fae4fa40373e70a3fa7c67d255647b33bcc Mon Sep 17 00:00:00 2001 From: VinGit67 <33829262+VinGit67@users.noreply.github.com> Date: Tue, 19 Nov 2019 13:24:56 +0100 Subject: [PATCH 4/5] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa912913d..23ca9d9ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,6 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml +variables: + ConnectedServiceName: 'SCFlaskPipe' + WebAppName: 'vdb67-pyflask' trigger: - master @@ -10,10 +9,30 @@ pool: vmImage: 'ubuntu-latest' steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.6' + architecture: 'x64' +- 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: 'startup.txt' -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' From 3e42975522febf1c1804cfa81cc76f8ca6007ba3 Mon Sep 17 00:00:00 2001 From: Vincent de Beet Date: Tue, 19 Nov 2019 13:29:40 +0100 Subject: [PATCH 5/5] Updated Copyright Year --- hello_app/templates/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_app/templates/layout.html b/hello_app/templates/layout.html index fd83b92c8..27cb94d47 100644 --- a/hello_app/templates/layout.html +++ b/hello_app/templates/layout.html @@ -18,7 +18,7 @@ {% endblock %}