From 98c35fc50ff379a1b2fab896f67f6e088930f917 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Fri, 3 May 2019 12:31:56 -0400 Subject: [PATCH 1/2] build matrix pass strings specify python version fix yaml order ugh maybe? fix script -> task fix i had it right fix matrix builder apparently variables are passed in as objects and not json use replace correctly fix python version test matrix output mark output variable use variable to resolve output var set matrix task name dump matrix --- azure-pipelines.yml | 188 +++++++++----------------------------------- 1 file changed, 36 insertions(+), 152 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 817ea0a..58b8fa8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,165 +1,49 @@ trigger: - develop +variables: + python: '["py2.7", "py3.4", "py3.5", "py3.6", "py3.7", "py3.8"]' + salt: '["v2018.3", "v2019.2", "develop"]' + backends: '["cherrypy", "tornado"]' + jobs: +- job: build_matrix + pool: + vmImage: 'Ubuntu-16.04' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: x64 + + - task: PythonScript@0 + name: matrix + inputs: + scriptSource: Inline + script: | + import json + matrix = {} + for pyver in $(python): + for saltver in $(salt): + for backend in $(backends): + matrix['{0}-{1}-{2}'.format(pyver, backend, saltver)] = { + 'python.version': pyver[2:], + 'version': pyver.replace('.', ''), + 'salt': saltver, + 'backend': backend, + } + print('##vso[task.setvariable variable=matrix;isOutput=true]{0}'.format(json.dumps(matrix))) - job: test_pepper + dependsOn: build_matrix pool: vmImage: 'Ubuntu-16.04' strategy: - matrix: - py2.7-v2018.3-cherrypy: - python.version: '2.7' - version: py27 - salt: v2018.3 - backend: cherrypy - py2.7-v2019.2-cherrypy: - python.version: '2.7' - version: py27 - salt: v2019.2 - backend: cherrypy - py2.7-develop-cherrypy: - python.version: '2.7' - version: py27 - salt: develop - backend: cherrypy - py2.7-v2018.3-tornado: - python.version: '2.7' - version: py27 - salt: v2018.3 - backend: tornado - py2.7-v2019.2-tornado: - python.version: '2.7' - version: py27 - salt: v2019.2 - backend: tornado - py2.7-develop-tornado: - python.version: '2.7' - version: py27 - salt: develop - backend: tornado - py3.4-v2018.3-cherrypy: - python.version: '3.4' - version: py34 - salt: v2018.3 - backend: cherrypy - py3.4-v2019.2-cherrypy: - python.version: '3.4' - version: py34 - salt: v2019.2 - backend: cherrypy - py3.4-develop-cherrypy: - python.version: '3.4' - version: py34 - salt: develop - backend: cherrypy - py3.4-v2018.3-tornado: - python.version: '3.4' - version: py34 - salt: v2018.3 - backend: tornado - py3.4-v2019.2-tornado: - python.version: '3.4' - version: py34 - salt: v2019.2 - backend: tornado - py3.4-develop-tornado: - python.version: '3.4' - version: py34 - salt: develop - backend: tornado - py3.5-v2018.3-cherrypy: - python.version: '3.5' - version: py35 - salt: v2018.3 - backend: cherrypy - py3.5-v2019.2-cherrypy: - python.version: '3.5' - version: py35 - salt: v2019.2 - backend: cherrypy - py3.5-develop-cherrypy: - python.version: '3.5' - version: py35 - salt: develop - backend: cherrypy - py3.5-v2018.3-tornado: - python.version: '3.5' - version: py35 - salt: v2018.3 - backend: tornado - py3.5-v2019.2-tornado: - python.version: '3.5' - version: py35 - salt: v2019.2 - backend: tornado - py3.5-develop-tornado: - python.version: '3.5' - version: py35 - salt: develop - backend: tornado - py3.6-v2018.3-cherrypy: - python.version: '3.6' - version: py36 - salt: v2018.3 - backend: cherrypy - py3.6-v2019.2-cherrypy: - python.version: '3.6' - version: py36 - salt: v2019.2 - backend: cherrypy - py3.6-develop-cherrypy: - python.version: '3.6' - version: py36 - salt: develop - backend: cherrypy - py3.6-v2018.3-tornado: - python.version: '3.6' - version: py36 - salt: v2018.3 - backend: tornado - py3.6-v2019.2-tornado: - python.version: '3.6' - version: py36 - salt: v2019.2 - backend: tornado - py3.6-develop-tornado: - python.version: '3.6' - version: py36 - salt: develop - backend: tornado - py3.7-v2017.3-cherrypy: - python.version: '3.7' - version: py37 - salt: v2017.3 - backend: cherrypy - py3.7-v2019.2-cherrypy: - python.version: '3.7' - version: py37 - salt: v2019.2 - backend: cherrypy - py3.7-develop-cherrypy: - python.version: '3.7' - version: py37 - salt: develop - backend: cherrypy - py3.7-v2017.3-tornado: - python.version: '3.7' - version: py37 - salt: v2017.3 - backend: tornado - py3.7-v2019.2-tornado: - python.version: '3.7' - version: py37 - salt: v2019.2 - backend: tornado - py3.7-develop-tornado: - python.version: '3.7' - version: py37 - salt: develop - backend: tornado - + matrix: $[ dependencies.build_matrix.outputs['matrix.matrix'] ] + variables: + myVar: $[ dependencies.build_matrix.outputs['matrix.matrix'] ] steps: + - script: echo $(myVar) - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' From ac87e4bf749f6a68b8bbb63a1510c7ed6393a19d Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Fri, 3 May 2019 13:54:54 -0400 Subject: [PATCH 2/2] remove debugging stuff --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 58b8fa8..87d32eb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,10 +40,7 @@ jobs: vmImage: 'Ubuntu-16.04' strategy: matrix: $[ dependencies.build_matrix.outputs['matrix.matrix'] ] - variables: - myVar: $[ dependencies.build_matrix.outputs['matrix.matrix'] ] steps: - - script: echo $(myVar) - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)'