-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecreate_containers.ps1
More file actions
60 lines (40 loc) · 1.29 KB
/
Copy pathrecreate_containers.ps1
File metadata and controls
60 lines (40 loc) · 1.29 KB
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
$ErrorActionPreference = "Stop"
# Ensure that is being run from dir where script locates (helpful when running on remote machine)
$workingDir = $(Get-Location).Path
Write-Host "Working directory:" $workingDir
if ($workingDir -ne $PSScriptRoot) {
Set-Location $PSScriptRoot
Write-Host "Changed working directory to script root:" $(Get-Location).Path
}
$workingDir = $(Get-Location).Path
# script
./remove_containers.ps1
# start all
Set-Location .\EFCore.Extensions.SaveOptimizer\Containers
$yamls = @(
'cockroach.yml',
'cockroach_multi.yml',
'sqlserver.yml',
'postgres.yml',
'mysql_pomelo.yml',
'mariadb_pomelo.yml',
'firebird_3.yml',
'firebird_4.yml',
'oracle_21.yml'
)
$ErrorActionPreference = 'SilentlyContinue'
$yamls | Foreach-Object -ThrottleLimit 15 -Parallel {
$workingDir = $using:workingDir
$item = $_
Set-Location $workingDir
Set-Location .\EFCore.Extensions.SaveOptimizer\Containers
$cmd = "docker compose --file $($item) up --detach"
Write-Host $cmd
cmd /c $cmd
Write-Host "$($item) finished"
}
$ErrorActionPreference = "Stop"
Start-Sleep -Seconds 5
docker compose --file cockroach_multi.yml exec optimizerroachmulti11 /cockroach/cockroach init --insecure
Start-Sleep -Seconds 5
Set-Location $workingDir