From e164576defc776f13021dc35bdd37090a43ac8ef Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Tue, 16 Apr 2019 12:31:06 -0700 Subject: [PATCH 01/33] 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..c23ced43c --- /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-16.04' + +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 5abde0d0385d79854de9fdce044c9b05417b4b92 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Tue, 16 Apr 2019 15:54:03 -0700 Subject: [PATCH 02/33] Add specific steps for App Service deploy [skip ci] --- azure-pipelines.yml | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c23ced43c..d77c6b923 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,19 +1,42 @@ -# 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: 'Primary (44f7aaf4-97f8-4aa9-a791-245ed34e3bd5)' + WebAppName: 'flaskpipelines' trigger: - master pool: - vmImage: 'Ubuntu-16.04' + name: Hosted Ubuntu 1604 steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.6' + architecture: 'x64' - script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' + python3.6 -m venv antenv3.6 + source antenv3.6/bin/activate + pip3.6 install setuptools + pip3.6 install -r requirements.txt + + # The displayName is shows 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' \ No newline at end of file From aa7fbd4af8654b86dc34376be53c3e818c86b36f Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Tue, 16 Apr 2019 15:57:30 -0700 Subject: [PATCH 03/33] Changing the service name [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d77c6b923..4f29337df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - ConnectedServiceName: 'Primary (44f7aaf4-97f8-4aa9-a791-245ed34e3bd5)' + ConnectedServiceName: 'Primary' WebAppName: 'flaskpipelines' trigger: From eb6b59869f3c65855ff1148f7c952a0ba8dba322 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Tue, 16 Apr 2019 16:00:42 -0700 Subject: [PATCH 04/33] Correct web app name [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4f29337df..8c71198b5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: ConnectedServiceName: 'Primary' - WebAppName: 'flaskpipelines' + WebAppName: 'msdocs-flaskpipelines' trigger: - master From da7e2d30f7f351f369b291f4d2ed6835f3859c0f Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Tue, 16 Apr 2019 16:15:52 -0700 Subject: [PATCH 05/33] Add startup command [skip ci] --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c71198b5..bfcc8a200 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,4 +39,5 @@ steps: RuntimeStack: 'PYTHON|3.6' ConnectedServiceName: $(ConnectedServiceName) WebAppName: $(WebAppName) - Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' \ No newline at end of file + Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' + StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' \ No newline at end of file From 1403acd88ba7b1f3fe6e70cdd62a0a7e31a6477c Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:31:44 -0700 Subject: [PATCH 06/33] Use post-deployment script for virtual environment [skip ci] --- azure-pipelines.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bfcc8a200..c45419baf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,14 +14,17 @@ steps: versionSpec: '3.6' architecture: 'x64' -- script: | - python3.6 -m venv antenv3.6 - source antenv3.6/bin/activate - pip3.6 install setuptools - pip3.6 install -r requirements.txt +# Install the virtual environment on the build agent, which is then +# deployed with the app code. - # The displayName is shows in the pipeline UI when a build runs - displayName: 'Install Dependencies' +# - script: | +# python3.6 -m venv antenv3.6 +# source antenv3.6/bin/activate +# pip3.6 install setuptools +# pip3.6 install -r requirements.txt +# +# # The displayName is shows in the pipeline UI when a build runs +# displayName: 'Install Dependencies' - task: ArchiveFiles@2 inputs: @@ -40,4 +43,11 @@ steps: ConnectedServiceName: $(ConnectedServiceName) WebAppName: $(WebAppName) Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' - StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' \ No newline at end of file + StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' + + ScriptType: Inline Script + InlineScript: + python3.6 -m venv antenv3.6 + source antenv3.6/bin/activate + pip3.6 install setuptools + pip3.6 install -r requirements.txt \ No newline at end of file From e0a3c3ca820e8a1d1f09d7494df7223243f77de1 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:41:20 -0700 Subject: [PATCH 07/33] Test post-deployment script [skip ci] --- azure-pipelines.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c45419baf..a1d8788cd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,8 @@ steps: ScriptType: Inline Script InlineScript: - python3.6 -m venv antenv3.6 - source antenv3.6/bin/activate - pip3.6 install setuptools - pip3.6 install -r requirements.txt \ No newline at end of file + echo "Hello" + #python3.6 -m venv antenv3.6 + #source antenv3.6/bin/activate + #pip3.6 install setuptools + #pip3.6 install -r requirements.txt \ No newline at end of file From 76f9ff7742bf667be7bfec8c738d160e67db9266 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:46:10 -0700 Subject: [PATCH 08/33] Another script test [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a1d8788cd..f950a793a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,7 @@ steps: ScriptType: Inline Script InlineScript: - echo "Hello" + ls -l #python3.6 -m venv antenv3.6 #source antenv3.6/bin/activate #pip3.6 install setuptools From 105dece441cd9eb345b9c26114b30702a42cbf3e Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:48:23 -0700 Subject: [PATCH 09/33] Add venv command [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f950a793a..abd300c66 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,7 +48,7 @@ steps: ScriptType: Inline Script InlineScript: ls -l - #python3.6 -m venv antenv3.6 + python3.6 -m venv antenv3.6 #source antenv3.6/bin/activate #pip3.6 install setuptools #pip3.6 install -r requirements.txt \ No newline at end of file From 348c028d3692e2601b67217bb511197c7322cb88 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:51:41 -0700 Subject: [PATCH 10/33] Use python3 in post-deployment [skip ci] --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abd300c66..5115318a1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,7 +48,7 @@ steps: ScriptType: Inline Script InlineScript: ls -l - python3.6 -m venv antenv3.6 - #source antenv3.6/bin/activate - #pip3.6 install setuptools - #pip3.6 install -r requirements.txt \ No newline at end of file + python3 -m venv antenv3.6 + source antenv3.6/bin/activate + pip3 install setuptools + pip3 install -r requirements.txt \ No newline at end of file From 177bc209a269ac1a43a853c8190adf2c97d88a8a Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 14:55:40 -0700 Subject: [PATCH 11/33] Change the Python commands [skip ci] --- azure-pipelines.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5115318a1..bcb2b461d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,8 +47,7 @@ steps: ScriptType: Inline Script InlineScript: - ls -l - python3 -m venv antenv3.6 + python3.6 -m venv antenv3.6 source antenv3.6/bin/activate - pip3 install setuptools - pip3 install -r requirements.txt \ No newline at end of file + pip install setuptools + pip install -r requirements.txt \ No newline at end of file From ffb61a249fdc5e41221a3e140d7d21484f025d1d Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:05:23 -0700 Subject: [PATCH 12/33] Test again [skip ci] --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bcb2b461d..ba231808a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,7 @@ steps: ScriptType: Inline Script InlineScript: - python3.6 -m venv antenv3.6 - source antenv3.6/bin/activate + python3.6 -m venv testenv + source testenv/bin/activate pip install setuptools pip install -r requirements.txt \ No newline at end of file From 02f005dab7ebb48ad15f08a43e2bf9a0fec88fac Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:07:16 -0700 Subject: [PATCH 13/33] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba231808a..3c0a877cc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,8 @@ steps: ScriptType: Inline Script InlineScript: - python3.6 -m venv testenv - source testenv/bin/activate - pip install setuptools - pip install -r requirements.txt \ No newline at end of file + ls -l + #python3.6 -m venv testenv + #source testenv/bin/activate + #pip install setuptools + #pip install -r requirements.txt \ No newline at end of file From 30437605d08995138125f8b0a8d590e91ef34dc1 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:09:03 -0700 Subject: [PATCH 14/33] Test sudo [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3c0a877cc..ad3850e8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,7 @@ steps: ScriptType: Inline Script InlineScript: - ls -l + sudo python 3.6 -m venv testenv1 #python3.6 -m venv testenv #source testenv/bin/activate #pip install setuptools From 26dc0d5c94a36b9c0726672e6bd3f0410b10a6e6 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:11:01 -0700 Subject: [PATCH 15/33] Try cd in post-deployment script [skip ci] --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad3850e8c..fa95a4967 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,8 @@ steps: ScriptType: Inline Script InlineScript: - sudo python 3.6 -m venv testenv1 + cd site/wwwroot + ls -l #python3.6 -m venv testenv #source testenv/bin/activate #pip install setuptools From c143b48cc412d19e28586ee1e91167e925989668 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:12:18 -0700 Subject: [PATCH 16/33] Try pwd command [skip ci] --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa95a4967..7cae9cb21 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,8 +47,7 @@ steps: ScriptType: Inline Script InlineScript: - cd site/wwwroot - ls -l + pwd #python3.6 -m venv testenv #source testenv/bin/activate #pip install setuptools From 9c730d76656b1d26f6f5dfa4bef097c2a350853c Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:14:39 -0700 Subject: [PATCH 17/33] Try pwd command [skip ci] --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7cae9cb21..63abf7665 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,7 +48,7 @@ steps: ScriptType: Inline Script InlineScript: pwd - #python3.6 -m venv testenv - #source testenv/bin/activate - #pip install setuptools - #pip install -r requirements.txt \ No newline at end of file + python3.6 -m venv testenv + source testenv/bin/activate + pip install setuptools + pip install -r requirements.txt \ No newline at end of file From 5665ace2bcc2c2206444eced0babfa0174a00bab Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:20:38 -0700 Subject: [PATCH 18/33] More tests [skip ci] --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 63abf7665..2c398405a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,7 +48,10 @@ steps: ScriptType: Inline Script InlineScript: pwd + echo "Trying venv" python3.6 -m venv testenv + echo "Trying source" source testenv/bin/activate + echo "Trying pip install" pip install setuptools pip install -r requirements.txt \ No newline at end of file From c5368195848e925f86ad6eb5c00ad620b1a599d6 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:23:15 -0700 Subject: [PATCH 19/33] Echo added [skip ci] --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2c398405a..8795f3e02 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,6 @@ steps: ScriptType: Inline Script InlineScript: - pwd echo "Trying venv" python3.6 -m venv testenv echo "Trying source" From b3cbd137345c262b388912268701bba1417a1d24 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:25:57 -0700 Subject: [PATCH 20/33] Remove one echo [skip ci] --- azure-pipelines.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8795f3e02..cb2c41256 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,11 +46,10 @@ steps: StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' ScriptType: Inline Script - InlineScript: - echo "Trying venv" - python3.6 -m venv testenv + InlineScript: + python3.6 -m venv testenv3.6 echo "Trying source" - source testenv/bin/activate + source testenv3.6/bin/activate echo "Trying pip install" pip install setuptools pip install -r requirements.txt \ No newline at end of file From 0b5e113eb26b747eead476c1d776108db83d94ba Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:30:23 -0700 Subject: [PATCH 21/33] Add post-deployment script --- post-deployment.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 post-deployment.sh diff --git a/post-deployment.sh b/post-deployment.sh new file mode 100644 index 000000000..e5d6ab3fd --- /dev/null +++ b/post-deployment.sh @@ -0,0 +1,4 @@ +python3.6 -m venv testenv3.6 +source testenv3.6/bin/activate +pip3.6 install setuptools +pip3.6 install -r requirements.txt From 810ec3c2451d7fc9b78873cbca90163f5c148569 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:30:40 -0700 Subject: [PATCH 22/33] Use external file [skip ci] --- azure-pipelines.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cb2c41256..1d8a3d7c4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,11 +45,5 @@ steps: Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' - ScriptType: Inline Script - InlineScript: - python3.6 -m venv testenv3.6 - echo "Trying source" - source testenv3.6/bin/activate - echo "Trying pip install" - pip install setuptools - pip install -r requirements.txt \ No newline at end of file + ScriptType: 'File Path' + FilePath: 'post-deployment.sh' From b58e15336b601042a075fa00c7cc720f4359dc9c Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 17 Apr 2019 15:33:48 -0700 Subject: [PATCH 23/33] Use ScriptPath as required [skip ci] --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1d8a3d7c4..133fd30d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,5 +45,5 @@ steps: Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' - ScriptType: 'File Path' - FilePath: 'post-deployment.sh' + ScriptType: File Path + ScriptPath: 'post-deployment.sh' From 473a94a8ea35e0b26141daf262839c5081412d66 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 24 Apr 2019 09:54:24 -0700 Subject: [PATCH 24/33] antevn3.6 > antenv --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 133fd30d1..f1c1a5fb3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,8 +18,8 @@ steps: # deployed with the app code. # - script: | -# python3.6 -m venv antenv3.6 -# source antenv3.6/bin/activate +# python3.6 -m venv antenv +# source antenv/bin/activate # pip3.6 install setuptools # pip3.6 install -r requirements.txt # From ae02f9ee799912e2e96c8faf2454846ecc97f1f1 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Wed, 24 Apr 2019 09:55:46 -0700 Subject: [PATCH 25/33] Use antenv in post-deployment script --- post-deployment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-deployment.sh b/post-deployment.sh index e5d6ab3fd..afde0d931 100644 --- a/post-deployment.sh +++ b/post-deployment.sh @@ -1,4 +1,4 @@ -python3.6 -m venv testenv3.6 -source testenv3.6/bin/activate +python3.6 -m venv antenv +source antenv/bin/activate pip3.6 install setuptools pip3.6 install -r requirements.txt From 8eef3744798feb812e4e0167b37a23f356bfbf8e Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Thu, 25 Apr 2019 10:03:56 -0700 Subject: [PATCH 26/33] Change to use venv on agent [skip ci] --- azure-pipelines.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1c1a5fb3..c9725f9fb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: ConnectedServiceName: 'Primary' - WebAppName: 'msdocs-flaskpipelines' + WebAppName: 'msdocs-flaskpipelines2' trigger: - master @@ -17,14 +17,14 @@ steps: # Install the virtual environment on the build agent, which is then # deployed with the app code. -# - script: | -# python3.6 -m venv antenv -# source antenv/bin/activate -# pip3.6 install setuptools -# pip3.6 install -r requirements.txt -# -# # The displayName is shows in the pipeline UI when a build runs -# displayName: 'Install Dependencies' +- script: | + python3.6 -m venv antenv + source antenv/bin/activate + pip3.6 install setuptools + pip3.6 install -r requirements.txt + + # The displayName is shows in the pipeline UI when a build runs + displayName: 'Install Dependencies' - task: ArchiveFiles@2 inputs: @@ -45,5 +45,5 @@ steps: Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' - ScriptType: File Path - ScriptPath: 'post-deployment.sh' + # ScriptType: File Path + # ScriptPath: 'post-deployment.sh' From 3950e30ff312402350184a435c4fddb82fe02a4a Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Thu, 25 Apr 2019 12:13:00 -0700 Subject: [PATCH 27/33] Add example post-deployment script --- azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c9725f9fb..d3f06eb4b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,5 +45,12 @@ steps: Package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip' StartupCommand: 'gunicorn --bind=0.0.0.0 --workers=4 startup:app' + # Inline post-deployment script + ScriptType: Inline Script + InlineScript: + echo 'Add your inline script steps here' + + # Alternate form: refer to a script in the repository # ScriptType: File Path # ScriptPath: 'post-deployment.sh' + From 43f3e4f7c36ab8fc11e83e0dbb5ef1d4c9d1ac31 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Thu, 25 Apr 2019 12:13:37 -0700 Subject: [PATCH 28/33] Correct app service name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d3f06eb4b..b050fdc1f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: ConnectedServiceName: 'Primary' - WebAppName: 'msdocs-flaskpipelines2' + WebAppName: 'msdocs-flaskpipelines' trigger: - master From eab207662f1d6a0045502a14ab6f67ad6f1bb208 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Mon, 26 Aug 2019 12:35:36 -0700 Subject: [PATCH 29/33] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines-1.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 000000000..aa912913d --- /dev/null +++ b/azure-pipelines-1.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 3b5e525fa0d518713303e47b60106a8d07b2003d Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Mon, 26 Aug 2019 13:57:10 -0700 Subject: [PATCH 30/33] Remove venv stuff --- azure-pipelines.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b050fdc1f..b88e4fb1b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: ConnectedServiceName: 'Primary' - WebAppName: 'msdocs-flaskpipelines' + WebAppName: 'kraigb-flaskpipelines' trigger: - master @@ -17,14 +17,14 @@ steps: # Install the virtual environment on the build agent, which is then # deployed with the app code. -- script: | - python3.6 -m venv antenv - source antenv/bin/activate - pip3.6 install setuptools - pip3.6 install -r requirements.txt +#- script: | + #python3.6 -m venv antenv + #source antenv/bin/activate + #pip3.6 install setuptools + #pip3.6 install -r requirements.txt # The displayName is shows in the pipeline UI when a build runs - displayName: 'Install Dependencies' + #displayName: 'Install Dependencies' - task: ArchiveFiles@2 inputs: From 7e06b00957220e13ade18dd29658a5a5d106f3e7 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Mon, 26 Aug 2019 14:43:51 -0700 Subject: [PATCH 31/33] Add steps to create and delete venv --- azure-pipelines.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b88e4fb1b..1698e45bf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,14 +17,19 @@ steps: # Install the virtual environment on the build agent, which is then # deployed with the app code. -#- script: | - #python3.6 -m venv antenv - #source antenv/bin/activate - #pip3.6 install setuptools - #pip3.6 install -r requirements.txt +- script: | + python3.6 -m venv .env + source .env/bin/activate + pip3.6 install setuptools + pip3.6 install -r requirements.txt # The displayName is shows in the pipeline UI when a build runs - #displayName: 'Install Dependencies' + displayName: 'Install Dependencies' + +- script: | + echo Deleting venv + rmdir /S .env + displayName: 'Remove .env before zip' - task: ArchiveFiles@2 inputs: From dde833832c05c9c88f0d0e8de85b7fa9a91458e3 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Mon, 26 Aug 2019 15:01:41 -0700 Subject: [PATCH 32/33] Correct rmdir flags --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1698e45bf..6aa00568c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,7 @@ steps: - script: | echo Deleting venv - rmdir /S .env + rmdir -rf .env displayName: 'Remove .env before zip' - task: ArchiveFiles@2 From c4d9720196d227e76894aa1fb18761c0ee8ed3d4 Mon Sep 17 00:00:00 2001 From: Kraig Brockschmidt Date: Mon, 26 Aug 2019 15:06:06 -0700 Subject: [PATCH 33/33] Use rm instead of rmdir --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6aa00568c..2013df360 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,9 @@ steps: - script: | echo Deleting venv - rmdir -rf .env + ls + rm -rf .env + ls displayName: 'Remove .env before zip' - task: ArchiveFiles@2