-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eng/common directory with azure-sdk-tools repository (#768)
- Loading branch information
Showing
8 changed files
with
71 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,40 @@ | ||
# Deploys resources to a cloud type specified by the variable (not parameter) | ||
# 'CloudType'. Use this as part of a matrix to deploy resources to a particular | ||
# cloud instance. Normally we would use template parameters instead of variables | ||
# but matrix variables are not available during template expansion so any | ||
# benefits of parameters are lost. | ||
|
||
parameters: | ||
ServiceDirectory: not-set | ||
ArmTemplateParameters: '@{}' | ||
DeleteAfterHours: 24 | ||
Location: '' | ||
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) | ||
|
||
# SubscriptionConfiguration will be splat into the parameters of the test | ||
# resources script. It should be JSON in the form: | ||
# { | ||
# "SubscriptionId": "<subscription id>", | ||
# "TenantId": "<tenant id>", | ||
# "TestApplicationId": "<test app id>", | ||
# "TestApplicationSecret": "<test app secret>", | ||
# "ProvisionerApplicationId": "<provisoner app id>", | ||
# "ProvisoinerApplicationSecret": "<provisoner app secert>", | ||
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>" | ||
# } | ||
|
||
steps: | ||
# New-TestResources command requires Az module | ||
- pwsh: Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose | ||
displayName: Install Azure PowerShell module | ||
|
||
- pwsh: > | ||
eng/common/TestResources/New-TestResources.ps1 | ||
-BaseName 'Generated' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-TenantId '$(aad-azure-sdk-test-tenant-id)' | ||
-SubscriptionId '$(azure-subscription-id)' | ||
-TestApplicationId '$(aad-azure-sdk-test-client-id)' | ||
-TestApplicationSecret '$(aad-azure-sdk-test-client-secret)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret)' | ||
-AdditionalParameters ${{ parameters.ArmTemplateParameters }} | ||
-DeleteAfterHours ${{ parameters.DeleteAfterHours }} | ||
-Location '${{ parameters.Location }}' | ||
-Environment 'AzureCloud' | ||
-CI | ||
-Force | ||
-Verbose | ||
displayName: Deploy test resources (AzureCloud) | ||
condition: and(succeeded(), eq(variables['CloudType'], 'AzureCloud')) | ||
- pwsh: > | ||
eng/common/TestResources/New-TestResources.ps1 | ||
-BaseName 'Generated' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-TenantId '$(aad-azure-sdk-test-tenant-id-gov)' | ||
-SubscriptionId '$(azure-subscription-id-gov)' | ||
-TestApplicationId '$(aad-azure-sdk-test-client-id-gov)' | ||
-TestApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-gov)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)' | ||
-AdditionalParameters ${{ parameters.ArmTemplateParameters }} | ||
-DeleteAfterHours ${{ parameters.DeleteAfterHours }} | ||
-Location '${{ parameters.Location }}' | ||
-Environment 'AzureUSGovernment' | ||
-CI | ||
-Force | ||
-Verbose | ||
displayName: Deploy test resources (AzureUSGovernment) | ||
condition: and(succeeded(), eq(variables['CloudType'], 'AzureUSGovernment')) | ||
- pwsh: | | ||
$subscriptionConfiguration = @" | ||
${{ parameters.SubscriptionConfiguration }} | ||
"@ | ConvertFrom-Json -AsHashtable; | ||
- pwsh: > | ||
eng/common/TestResources/New-TestResources.ps1 | ||
-BaseName 'Generated' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-TenantId '$(aad-azure-sdk-test-tenant-id-cn)' | ||
-SubscriptionId '$(azure-subscription-id-cn)' | ||
-TestApplicationId '$(aad-azure-sdk-test-client-id-cn)' | ||
-TestApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-cn)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)' | ||
-AdditionalParameters ${{ parameters.ArmTemplateParameters }} | ||
-DeleteAfterHours ${{ parameters.DeleteAfterHours }} | ||
-Location '${{ parameters.Location }}' | ||
-Environment 'AzureChinaCloud' | ||
-CI | ||
-Force | ||
-Verbose | ||
displayName: Deploy test resources (AzureChinaCloud) | ||
condition: and(succeeded(), eq(variables['CloudType'], 'AzureChinaCloud')) | ||
eng/common/TestResources/New-TestResources.ps1 ` | ||
-BaseName 'Generated' ` | ||
-ServiceDirectory ${{ parameters.ServiceDirectory }} ` | ||
-Location '${{ parameters.Location }}' ` | ||
-DeleteAfterHours ${{ parameters.DeleteAfterHours }} ` | ||
-AdditionalParameters ${{ parameters.ArmTemplateParameters }} ` | ||
@subscriptionConfiguration ` | ||
-CI ` | ||
-Force ` | ||
-Verbose | ||
displayName: Deploy test resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,35 @@ | ||
# Removes resources from a cloud type specified by the variable (not parameter) | ||
# 'CloudType'. Use this as part of a matrix to remove resources from a | ||
# particular cloud instance. Normally we would use template variables instead of | ||
# parameters but matrix variables are not available during template expansion | ||
# so any benefits of parameters are lost. | ||
|
||
# Assumes steps in deploy-test-resources.yml was run previously. Requires | ||
# environment variable: AZURE_RESOURCEGROUP_NAME and Az PowerShell module | ||
|
||
parameters: | ||
ServiceDirectory: '' | ||
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) | ||
|
||
steps: | ||
- pwsh: > | ||
eng/common/TestResources/Remove-TestResources.ps1 | ||
-ResourceGroupName "${env:AZURE_RESOURCEGROUP_NAME}" | ||
-TenantId '$(aad-azure-sdk-test-tenant-id)' | ||
-SubscriptionId '$(azure-subscription-id)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret)' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-Environment 'AzureCloud' | ||
-Force | ||
-Verbose | ||
displayName: Remove test resources (AzureCloud) | ||
condition: and(ne(variables['AZURE_RESOURCEGROUP_NAME'], ''), eq(variables['CloudType'], 'AzureCloud')) | ||
continueOnError: true | ||
# SubscriptionConfiguration will be splat into the parameters of the test | ||
# resources script. It should be JSON in the form: | ||
# { | ||
# "SubscriptionId": "<subscription id>", | ||
# "TenantId": "<tenant id>", | ||
# "TestApplicationId": "<test app id>", | ||
# "TestApplicationSecret": "<test app secret>", | ||
# "ProvisionerApplicationId": "<provisoner app id>", | ||
# "ProvisoinerApplicationSecret": "<provisoner app secert>", | ||
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>" | ||
# } | ||
# The Remove-TestResources.ps1 script accommodates extra parameters so it will | ||
# not error when parameters are provided which the script doesn't use. | ||
|
||
- pwsh: > | ||
eng/common/TestResources/Remove-TestResources.ps1 | ||
-ResourceGroupName "${env:AZURE_RESOURCEGROUP_NAME}" | ||
-TenantId '$(aad-azure-sdk-test-tenant-id-gov)' | ||
-SubscriptionId '$(azure-subscription-id-gov)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-gov)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-Environment 'AzureUSGovernment' | ||
-Force | ||
-Verbose | ||
displayName: Remove test resources (AzureUSGovernment) | ||
condition: and(ne(variables['AZURE_RESOURCEGROUP_NAME'], ''), eq(variables['CloudType'], 'AzureUSGovernment')) | ||
continueOnError: true | ||
steps: | ||
- pwsh: | | ||
$subscriptionConfiguration = @" | ||
${{ parameters.SubscriptionConfiguration }} | ||
"@ | ConvertFrom-Json -AsHashtable; | ||
- pwsh: > | ||
eng/common/TestResources/Remove-TestResources.ps1 | ||
-ResourceGroupName "${env:AZURE_RESOURCEGROUP_NAME}" | ||
-TenantId '$(aad-azure-sdk-test-tenant-id-cn)' | ||
-SubscriptionId '$(azure-subscription-id-cn)' | ||
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-cn)' | ||
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)' | ||
-ServiceDirectory '${{ parameters.ServiceDirectory }}' | ||
-Environment 'AzureChinaCloud' | ||
-Force | ||
-Verbose | ||
displayName: Remove test resources (AzureChinaCloud) | ||
condition: and(ne(variables['AZURE_RESOURCEGROUP_NAME'], ''), eq(variables['CloudType'], 'AzureChinaCloud')) | ||
eng/common/TestResources/Remove-TestResources.ps1 ` | ||
-ResourceGroupName "${env:AZURE_RESOURCEGROUP_NAME}" ` | ||
-ServiceDirectory ${{ parameters.ServiceDirectory }} ` | ||
@subscriptionConfiguration ` | ||
-Force ` | ||
-Verbose | ||
displayName: Remove test resources | ||
continueOnError: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters