-
Notifications
You must be signed in to change notification settings - Fork 276
/
run-tye.ps1
42 lines (33 loc) · 887 Bytes
/
run-tye.ps1
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
<# Check development certificates #>
if (! ( Test-Path ".\etc\dev-cert\localhost.pfx" -PathType Leaf ) ){
Write-Information "Creating dev certificates..."
cd ".\etc\dev-cert"
.\create-certificate.ps1
cd..
cd ..
}
<# Check Docker containers #>
docker network create eshoponabp-network
$requiredServices = @(
'postgres-db',
'rabbitmq',
'redis'
)
foreach ($requiredService in $requiredServices) {
$nameParam = -join("name=", $requiredService)
$serviceRunningStatus = docker ps --filter $nameParam
$isDockerImageUp = $serviceRunningStatus -split " " -contains $requiredService
if( $isDockerImageUp )
{
Write-Host ($requiredService + " [up]")
}
else
{
cd "./etc/docker/"
docker-compose -f docker-compose.infrastructure.yml -f docker-compose.infrastructure.override.yml up -d
cd ../..
break;
}
}
<# Run all services #>
tye run --watch