Skip to content

Commit

Permalink
Fix casing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian F. Thomsen committed Mar 28, 2023
1 parent f97250e commit 6bce287
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
22 changes: 16 additions & 6 deletions source/AcceptanceTests/deploy/deploy.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
param ($Subscription, $ResourceGroup, $SqlServerName, $NamespaceName, $PrNumber)
param (
[Parameter(Mandatory=$true)]
[string]$Subscription,
[Parameter(Mandatory=$true)]
[string]$ResourceGroup,
[Parameter(Mandatory=$true)]
[string]$SqlServerName,
[Parameter(Mandatory=$true)]
[string]$NamespaceName,
[Parameter(Mandatory=$true)]
[string]$PrNumber)

function CreateDatabase {
$DatabaseName = "Test-$PrNumber"
az sql db create --resource-group $ResourceGroup --server $SqlServerName --name $DatabaseName --edition Basic
$databaseName = "Test-$PrNumber"
az sql db create --resource-group $ResourceGroup --server $SqlServerName --name $databaseName --edition Basic
}

function CreateServiceBusTopics {
$IntegrationEventsTopic = "IntegrationEvents-$PrNumber"
$(az servicebus topic create --resource-group $ResourceGroup --namespace-name $NamespaceName --name $IntegrationEventsTopic) | Out-Null
$(az servicebus topic subscription create --resource-group $ResourceGroup --namespace-name $NamespaceName --topic-name $IntegrationEventsTopic --name All-Events) | Out-Null
$integrationEventsTopic = "IntegrationEvents-$PrNumber"
$(az servicebus topic create --resource-group $ResourceGroup --namespace-name $NamespaceName --name $integrationEventsTopic) | Out-Null
$(az servicebus topic subscription create --resource-group $ResourceGroup --namespace-name $NamespaceName --topic-name $integrationEventsTopic --name All-Events) | Out-Null
}

function CreateServiceBusQueues {
Expand Down
28 changes: 16 additions & 12 deletions source/AcceptanceTests/deploy/teardown.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
param(
[string] $subscription = $(throw "-subscription is required"),
[string] $resourceGroup = $(throw "-resourcegroup is required"),
[string] $sqlServerName = $(throw "-sqlServerName is required"),
[string] $namespaceName = $(throw "-namespaceName is required"),
[string] $prNumber = $(throw "-prNumber is required")
)
[Parameter(Mandatory=$true)]
[string]$Subscription,
[Parameter(Mandatory=$true)]
[string]$ResourceGroup,
[Parameter(Mandatory=$true)]
[string]$SqlServerName,
[Parameter(Mandatory=$true)]
[string]$NamespaceName,
[Parameter(Mandatory=$true)]
[string]$PrNumber)

function DeleteDatabase {
$databaseName = "Test-$prNumber"
az sql db delete --name $databaseName --resource-group $resourceGroup --server $sqlServerName | Out-Null
az sql db delete --name $databaseName --resource-group $ResourceGroup --server $SqlServerName | Out-Null
}

function DeleteServiceBusTopics {
$integrationEventsTopic = "IntegrationEvents-$prNumber"
az servicebus topic subscription delete --resource-group $resourceGroup --namespace-name $namespaceName --topic-name $integrationEventsTopic --name All-Events | Out-Null
az servicebus topic delete --resource-group $resourceGroup --namespace-name $namespaceName --name $integrationEventsTopic | Out-Null
$integrationEventsTopic = "IntegrationEvents-$PrNumber"
az servicebus topic subscription delete --resource-group $ResourceGroup --namespace-name $NamespaceName --topic-name $integrationEventsTopic --name All-Events | Out-Null
az servicebus topic delete --resource-group $ResourceGroup --namespace-name $NamespaceName --name $integrationEventsTopic | Out-Null
}

function DeleteServiceBusQueues {
az servicebus queue delete --resource-group $resourceGroup --namespace-name $namespaceName --name "Command-$prNumber" | Out-Null
az servicebus queue delete --resource-group $ResourceGroup --namespace-name $NamespaceName --name "Command-$PrNumber" | Out-Null
}

az account set -s $subscription
az account set -s $Subscription

#DeleteDatabase
DeleteServiceBusTopics
Expand Down

0 comments on commit 6bce287

Please sign in to comment.