-
Notifications
You must be signed in to change notification settings - Fork 1
/
pr-pipelines.yml
executable file
·110 lines (104 loc) · 3.57 KB
/
pr-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
trigger: none
pr:
- dev
pool:
vmImage: 'ubuntu-18.04'
jobs:
- job: CreateResourceGroups
steps:
- bash: |
echo "##vso[task.setvariable variable=resource_group;isOutput=true]ansibletest-$(uuidgen)"
echo "##vso[task.setvariable variable=resource_group_secondary;isOutput=true]ansibletest2-$(uuidgen)"
name: setvar
- bash: |
echo "Generate test resource group $(setvar.resource_group), $(setvar.resource_group_secondary)"
- task: AzureCLI@2
inputs:
azureSubscription: '$(SUBSCRIPTION_FULL_NAME)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az group create -l eastus -n $(setvar.resource_group)
az group create -l eastus -n $(setvar.resource_group_secondary)
# - job: RunTests
# dependsOn: CreateResourceGroups
# variables:
# TEST_RESOURCE_GROUP: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group'] ]
# TEST_RESOURCE_GROUP_SECONDARY: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_secondary'] ]
# strategy:
# matrix:
# Python_sanity:
# python.version: '$(PYTHON_VER)'
# test.key: 'sanity'
# Python_1:
# python.version: '$(PYTHON_VER)'
# test.key: '1'
# Python_2:
# python.version: '$(PYTHON_VER)'
# test.key: '2'
# Python_3:
# python.version: '$(PYTHON_VER)'
# test.key: '3'
# Python_4:
# python.version: '$(PYTHON_VER)'
# test.key: '4'
# Python_5:
# python.version: '$(PYTHON_VER)'
# test.key: '5'
# Python_6:
# python.version: '$(PYTHON_VER)'
# test.key: '6'
# Python_7:
# python.version: '$(PYTHON_VER)'
# test.key: '7'
# Python_9:
# python.version: '$(PYTHON_VER)'
# test.key: '9'
# Python_10:
# python.version: '$(PYTHON_VER)'
# test.key: '10'
# Python_11:
# python.version: '$(PYTHON_VER)'
# test.key: '11'
# Python_12:
# python.version: '$(PYTHON_VER)'
# test.key: '12'
# Python_13:
# python.version: '$(PYTHON_VER)'
# test.key: '13'
# Python_14:
# python.version: '$(PYTHON_VER)'
# test.key: '14'
#
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- script: ado.sh
env:
SHIPPABLE_BUILD_DIR: $(Build.Repository.LocalPath)
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
AZURE_SECRET: $(AZURE_SECRET)
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_TENANT: $(AZURE_TENANT)
RESOURCE_GROUP: $(TEST_RESOURCE_GROUP)
RESOURCE_GROUP_SECONDARY: $(TEST_RESOURCE_GROUP_SECONDARY)
displayName: 'Running Tests'
- job: CleanupResourceGroups
dependsOn:
- CreateResourceGroups
- RunTests
condition: always()
variables:
TEST_RESOURCE_GROUP: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group'] ]
TEST_RESOURCE_GROUP_SECONDARY: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_secondary'] ]
steps:
- task: AzureCLI@2
inputs:
azureSubscription: '$(SUBSCRIPTION_FULL_NAME)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az group delete -n $(TEST_RESOURCE_GROUP) --yes --no-wait
az group delete -n $(TEST_RESOURCE_GROUP_SECONDARY) --yes --no-wait