diff options
Diffstat (limited to 'collections-debian-merged/ansible_collections/azure/azcollection/pr-pipelines.yml')
-rw-r--r-- | collections-debian-merged/ansible_collections/azure/azcollection/pr-pipelines.yml | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/collections-debian-merged/ansible_collections/azure/azcollection/pr-pipelines.yml b/collections-debian-merged/ansible_collections/azure/azcollection/pr-pipelines.yml new file mode 100644 index 00000000..a78ec27f --- /dev/null +++ b/collections-debian-merged/ansible_collections/azure/azcollection/pr-pipelines.yml @@ -0,0 +1,208 @@ +parameters: +- name: PYTHON_VER + displayName: 'Python Version' + type: string + default: "3.6" + values: + - "2.7" + - "3.6" + - "3.8" +- name: ANSIBLE_VER + displayName: 'Ansible Version' + type: string + default: "2.10" + values: + - "2.9" + - "2.10" + - "devel" +- name: MODULE_NAME + displayName: 'Test Module' + type: string + default: 'all' + values: + - 'all' + - "azure_rm_acs" + - "azure_rm_aks" + - "azure_rm_appgateway" + - "azure_rm_appserviceplan" + - "azure_rm_automationaccount" + - "azure_rm_autoscale" + - "azure_rm_availabilityset" + - "azure_rm_azurefirewall" + - "azure_rm_batchaccount" + - "azure_rm_cdnprofile" + - "azure_rm_containerinstance" + - "azure_rm_containerregistry" + - "azure_rm_cosmosdbaccount" + - "azure_rm_deployment" + - "azure_rm_dnsrecordset" + - "azure_rm_dnszone" + - "azure_rm_functionapp" + - "azure_rm_gallery" + - "azure_rm_hdinsightcluster" + - "azure_rm_image" + - "azure_rm_iothub" + - "azure_rm_keyvault" + - "azure_rm_keyvaultkey" + - "azure_rm_keyvaultsecret" + - "azure_rm_loadbalancer" + - "azure_rm_loganalyticsworkspace" + - "azure_rm_manageddisk" + - "azure_rm_mariadbserver" + - "azure_rm_monitorlogprofile" + - "azure_rm_mysqlserver" + - "azure_rm_networkinterface" + - "azure_rm_openshiftmanagedcluster" + - "azure_rm_postgresqlserver" + - "azure_rm_privatednsrecordset" + - "azure_rm_privatednszone" + - "azure_rm_publicipaddress" + - "azure_rm_rediscache" + - "azure_rm_resource" + - "azure_rm_resourcegroup" + - "azure_rm_routetable" + - "azure_rm_roleassignment" + - "azure_rm_registrationassignment" + - "azure_rm_registrationdefinition" + - "azure_rm_securitygroup" + - "azure_rm_servicebus" + - "azure_rm_sqlserver" + - "azure_rm_storageaccount" + - "azure_rm_storageblob" + - "azure_rm_subnet" + - "azure_rm_subscription" + - "azure_rm_trafficmanagerprofile" + - "azure_rm_virtualmachine" + - "azure_rm_virtualmachineextension" + - "azure_rm_virtualmachineimage_info" + - "azure_rm_virtualmachinescaleset" + - "azure_rm_virtualnetwork" + - "azure_rm_virtualnetworkgateway" + - "azure_rm_virtualnetworkeepring" + - "azure_rm_backupazurevm" + - "azure_rm_recoveryservicesvault" + - "azure_rm_vmbackuppolicy" + - "azure_rm_webapp" + - "azure_rm_workspace" + - "inventory_azure" + - "setup_azure" + +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)" + echo "##vso[task.setvariable variable=resource_group_datalake;isOutput=true]ansibletest-$(uuidgen)" + + name: setvar + - bash: | + echo "Generate test resource group $(setvar.resource_group), $(setvar.resource_group_secondary), $(setvar.resource_group_datalake)" + - 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) + az group create -l eastus2 -n $(setvar.resource_group_datalake) + + - 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'] ] + TEST_RESOURCE_GROUP_DATALAKE: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_datalake'] ] + strategy: + matrix: + "Python${{ parameters.PYTHON_VER }}_sanity": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: 'sanity' + "Python${{ parameters.PYTHON_VER }}_1": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '1' + "Python${{ parameters.PYTHON_VER }}_2": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '2' + "Python${{ parameters.PYTHON_VER }}_3": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '3' + "Python${{ parameters.PYTHON_VER }}_4": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '4' + "Python${{ parameters.PYTHON_VER }}_5": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '5' + "Python${{ parameters.PYTHON_VER }}_6": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '6' + "Python${{ parameters.PYTHON_VER }}_7": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '7' + "Python${{ parameters.PYTHON_VER }}_9": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '9' + "Python${{ parameters.PYTHON_VER }}_10": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '10' + "Python${{ parameters.PYTHON_VER }}_11": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '11' + "Python${{ parameters.PYTHON_VER }}_12": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '12' + "Python${{ parameters.PYTHON_VER }}_13": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '13' + "Python${{ parameters.PYTHON_VER }}_14": + python.version: '${{ parameters.PYTHON_VER }}' + test.key: '14' + + steps: + - task: UsePythonVersion@0 + displayName: 'Use Python $(python.version)' + inputs: + versionSpec: '$(python.version)' + + - script: tests/utils/ado/ado.sh $(test.key) ${{ parameters.PYTHON_VER }} ${{ parameters.ANSIBLE_VER }} ${{ parameters.MODULE_NAME }} + env: + SHIPPABLE_BUILD_DIR: $(Build.Repository.LocalPath) + AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) + AZURE_SECRET: $(AZURE_SECRET) + AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID) + AZURE_SUBSCRIPTION_SEC_ID: $(AZURE_SUBSCRIPTION_SEC_ID) + AZURE_TENANT: $(AZURE_TENANT) + AZURE_PRINCIPAL_ID: $(AZURE_PRINCIPAL_ID) + AZURE_MANAGED_BY_TENANT_ID: $(AZURE_MANAGED_BY_TENANT_ID) + AZURE_ROLE_DEFINITION_ID: $(AZURE_ROLE_DEFINITION_ID) + RESOURCE_GROUP: $(TEST_RESOURCE_GROUP) + RESOURCE_GROUP_SECONDARY: $(TEST_RESOURCE_GROUP_SECONDARY) + RESOURCE_GROUP_DATALAKE: $(TEST_RESOURCE_GROUP_DATALAKE) + 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 |