Skip to content

Commit

Permalink
Update e2e-test.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
bachuv authored Dec 29, 2023
1 parent ce16c82 commit f2dc022
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/SmokeTests/e2e-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ if ($MSSQLTest -eq $true) {
# Build the Docker image first, since that's the most critical step
Write-Host "Building sample app Docker container from '$DockerfilePath'..." -ForegroundColor Yellow
docker build -f $DockerfilePath -t $ImageName --progress plain $PSScriptRoot/../../

# Next, download and start the Azurite emulator Docker image
Write-Host "Pulling down the mcr.microsoft.com/azure-storage/azurite:$AzuriteVersion image..." -ForegroundColor Yellow
docker pull "mcr.microsoft.com/azure-storage/azurite:${AzuriteVersion}"

Write-Host "Starting Azurite storage emulator using default ports..." -ForegroundColor Yellow
docker run --name 'azurite' -p 10000:10000 -p 10001:10001 -p 10002:10002 -d "mcr.microsoft.com/azure-storage/azurite:${AzuriteVersion}"

Write-Host "Pulling down the mcr.microsoft.com/mssql/server:$tag image..."
docker pull mcr.microsoft.com/mssql/server:$tag
Expand All @@ -59,9 +66,10 @@ if ($MSSQLTest -eq $true) {
Start-Sleep -Seconds 30 # Adjust the sleep duration based on your SQL Server container startup time

# Finally, start up the application container, connecting to the SQL Server container
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d `
Write-Host "Starting the $ContainerName application container" -ForegroundColor Yellow
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d `
--env 'SQLDB_Connection=Server=$ContainerName,1433;Database=YourDatabase;User=sa;Password=$pw;' `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;' `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' `
--env 'WEBSITE_HOSTNAME=localhost:8080' `
$ImageName

Expand Down

0 comments on commit f2dc022

Please sign in to comment.