From af6ee969eb3cf91edd00736e99173f4f58356169 Mon Sep 17 00:00:00 2001 From: The-Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Wed, 6 May 2020 19:46:11 +0200 Subject: [PATCH 01/15] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..7d405f9ee --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,36 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' +strategy: + matrix: + Python27: + python.version: '2.7' + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' From e2aaae55df855d7523d7503cf91e0640216e94cd Mon Sep 17 00:00:00 2001 From: The-Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Wed, 6 May 2020 20:00:30 +0200 Subject: [PATCH 02/15] Added dummy test case --- test_test1.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test_test1.py b/test_test1.py index df1dc6821..60cf93f04 100644 --- a/test_test1.py +++ b/test_test1.py @@ -1 +1,6 @@ -print('Hello World') +def func(x): + return x + 2 + +def test_func(): + assert func(2) == 4 + From 6e396b285c7d6a8089bb4fd97c3390c511739b93 Mon Sep 17 00:00:00 2001 From: The-Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Wed, 6 May 2020 20:08:27 +0200 Subject: [PATCH 03/15] import unittest --- test_test1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_test1.py b/test_test1.py index 60cf93f04..c745113c0 100644 --- a/test_test1.py +++ b/test_test1.py @@ -1,3 +1,5 @@ +import unittest + def func(x): return x + 2 From 25365d6d81d4992cc7e40e976332522c25b0e770 Mon Sep 17 00:00:00 2001 From: Alex Heyman Date: Thu, 7 May 2020 10:05:53 +0200 Subject: [PATCH 04/15] Removed lower python and added python3.8 --- azure-pipelines.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7d405f9ee..aa69e1ec7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,14 +10,8 @@ pool: vmImage: 'ubuntu-latest' strategy: matrix: - Python27: - python.version: '2.7' - Python35: - python.version: '3.5' - Python36: - python.version: '3.6' - Python37: - python.version: '3.7' + Python38: + python.version: '3.8' steps: - task: UsePythonVersion@0 From eb92d43bb041ddaa052678c855269494fe079a00 Mon Sep 17 00:00:00 2001 From: Alex Heyman Date: Thu, 7 May 2020 10:43:41 +0200 Subject: [PATCH 05/15] Added python3.8.2 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa69e1ec7..385b54ea2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,7 @@ pool: strategy: matrix: Python38: - python.version: '3.8' + python.version: '3.8.2' steps: - task: UsePythonVersion@0 From 3d89f7dd339c4f5df5ebfa65d777f4e150355a27 Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 13:11:09 +0200 Subject: [PATCH 06/15] Added BlackDuck Task --- azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 385b54ea2..5b8a4f3a5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,3 +28,9 @@ steps: pip install pytest pytest-azurepipelines pytest displayName: 'pytest' + +- task: SynopsysDetectTask@2 + inputs: + Products: 'BD' + BlackDuckService: 'BlackDuck-ADO-Test' + DetectVersion: 'latest' \ No newline at end of file From 2894cd3a02f485af8f7a4ea2fb79fb9dd4983eae Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 14:26:37 +0200 Subject: [PATCH 07/15] Add Synopsis Detect Task --- azure-pipelines.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5b8a4f3a5..2abf292cd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,4 +33,16 @@ steps: inputs: Products: 'BD' BlackDuckService: 'BlackDuck-ADO-Test' - DetectVersion: 'latest' \ No newline at end of file + DetectVersion: 'latest' + DetectArguments: | + --blackduck.trust.cert=true + --detect.project.name="The-Heyman.python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.name="1.0.0" + --detect.code.location.name="The-Heyman.python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.phase="DEVELOPMENT" + --detect.detector.search.depth="1" + --detect.project.tier="1" + --logging.level.detect="DEBUG" + --logging.level.com.synopsys.integration="DEBUG" + --blackduck.timeout=120 + --detect.report.timeout=300 \ No newline at end of file From 956a81a6a0d28da07f346852159028294931d753 Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 22:06:02 +0200 Subject: [PATCH 08/15] add windows agent --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2abf292cd..2a4ea13a1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - master pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' strategy: matrix: Python38: @@ -36,13 +36,13 @@ steps: DetectVersion: 'latest' DetectArguments: | --blackduck.trust.cert=true - --detect.project.name="The-Heyman.python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" --detect.project.version.name="1.0.0" - --detect.code.location.name="The-Heyman.python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.code.location.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" --detect.project.version.phase="DEVELOPMENT" --detect.detector.search.depth="1" --detect.project.tier="1" --logging.level.detect="DEBUG" --logging.level.com.synopsys.integration="DEBUG" --blackduck.timeout=120 - --detect.report.timeout=300 \ No newline at end of file + --detect.report.timeout=300 From 6269caa801d701d2890598023504b80f899886df Mon Sep 17 00:00:00 2001 From: Alex Heyman Date: Thu, 7 May 2020 22:15:32 +0200 Subject: [PATCH 09/15] Add date script --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2a4ea13a1..085a1551f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,6 +23,8 @@ steps: python -m pip install --upgrade pip pip install -r requirements.txt displayName: 'Install dependencies' +- script: + echo date - script: | pip install pytest pytest-azurepipelines From b0068bc07c27b60480a1d29eb7b11278b8f3ba12 Mon Sep 17 00:00:00 2001 From: Alex Heyman Date: Thu, 7 May 2020 23:05:55 +0200 Subject: [PATCH 10/15] changed agent to ubuntu --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 085a1551f..b753285ac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - master pool: - vmImage: 'windows-latest' + vmImage: 'ubuntu-latest' strategy: matrix: Python38: From 934bbbe846ad01bce818424df981e6de7fbaab08 Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 23:10:48 +0200 Subject: [PATCH 11/15] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b753285ac..085a1551f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - master pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' strategy: matrix: Python38: From a79b127902986d4164b964ba7b034642cd0bbf1e Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 23:15:27 +0200 Subject: [PATCH 12/15] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 085a1551f..b5e44c0ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,20 +31,5 @@ steps: pytest displayName: 'pytest' -- task: SynopsysDetectTask@2 - inputs: - Products: 'BD' - BlackDuckService: 'BlackDuck-ADO-Test' - DetectVersion: 'latest' - DetectArguments: | - --blackduck.trust.cert=true - --detect.project.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" - --detect.project.version.name="1.0.0" - --detect.code.location.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" - --detect.project.version.phase="DEVELOPMENT" - --detect.detector.search.depth="1" - --detect.project.tier="1" - --logging.level.detect="DEBUG" - --logging.level.com.synopsys.integration="DEBUG" - --blackduck.timeout=120 - --detect.report.timeout=300 + + From c69248005483dd11bf5069ff721b1dc182c3902d Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 23:16:41 +0200 Subject: [PATCH 13/15] chaos --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b5e44c0ba..994a8cdcb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,3 +33,4 @@ steps: +# total chaos From 968c99fe9a3c4452de88b1b20425215e11edf706 Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 23:19:35 +0200 Subject: [PATCH 14/15] add black duck task --- azure-pipelines.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 994a8cdcb..7b53202b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,5 +32,20 @@ steps: displayName: 'pytest' - -# total chaos +- task: SynopsysDetectTask@2 + inputs: + Products: 'BD' + BlackDuckService: 'BlackDuck-ADO-Test' + DetectVersion: 'latest' + DetectArguments: | + --blackduck.trust.cert=true + --detect.project.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.name="1.0.0" + --detect.code.location.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.phase="DEVELOPMENT" + --detect.detector.search.depth="1" + --detect.project.tier="1" + --logging.level.detect="DEBUG" + --logging.level.com.synopsys.integration="DEBUG" + --blackduck.timeout=120 + --detect.report.timeout=300 From e647a815a25bd6e46a3456b40869750fa1215129 Mon Sep 17 00:00:00 2001 From: Alex Heyman <35301662+The-Heyman@users.noreply.github.com> Date: Thu, 7 May 2020 23:21:17 +0200 Subject: [PATCH 15/15] wtf --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b53202b4..6fd7727c2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,7 @@ steps: - task: SynopsysDetectTask@2 inputs: Products: 'BD' - BlackDuckService: 'BlackDuck-ADO-Test' + BlackDuckService: 'BlackDuck-ADO-Test-Python3.8' DetectVersion: 'latest' DetectArguments: | --blackduck.trust.cert=true