-
Notifications
You must be signed in to change notification settings - Fork 1
/
ges-up.ps1
56 lines (53 loc) · 2.33 KB
/
ges-up.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Param(
[Parameter(Mandatory=$false)]
[Switch]$noDbBuild,
[Parameter(Mandatory=$false)]
[Switch]$noServiceBuild,
[Parameter(Mandatory=$false)]
[Switch]$dev
)
if ($dev) {
$efile = "./compose/ges/docker-compose.ges.dev.yaml"
}
else {
$efile = "./compose/ges/docker-compose.ges.test.yaml"
}
if($noServiceBuild -eq $false) {
Write-Output "---------------------------------------------------------------------------"
Write-Output "Building solution"
Write-Output "---------------------------------------------------------------------------"
dotnet publish ./HealthcareSystem/HealthcareSystem.sln -c Release
}
Write-Output "---------------------------------------------------------------------------"
Write-Output "Removing existing services"
Write-Output "---------------------------------------------------------------------------"
docker-compose -f ./compose/ges/docker-compose.ges.yaml -f $efile down -v
if($noDbBuild -eq $false) {
Write-Output "---------------------------------------------------------------------------"
Write-Output "Building database image"
Write-Output "---------------------------------------------------------------------------"
if ($dev -eq $false) {
docker build ./HealthcareSystem/Backend -f ./HealthcareSystem/Backend/Dockerfile.postgre -t seeded-postgre
}
else {
docker build ./HealthcareSystem/Backend -f ./HealthcareSystem/Backend/Dockerfile.mysql -t seeded-mysql
}
Write-Output "---------------------------------------------------------------------------"
Write-Output "Building event database image"
Write-Output "---------------------------------------------------------------------------"
if ($dev -eq $false) {
docker build ./HealthcareSystem/EventSourcingService -f ./HealthcareSystem/EventSourcingService/Dockerfile.postgre -t ess-postgre
}
else {
docker build ./HealthcareSystem/EventSourcingService -f ./HealthcareSystem/EventSourcingService/Dockerfile.mysql -t ess-mysql
}
}
Write-Output "---------------------------------------------------------------------------"
Write-Output "Starting services (GraphicalEditorServer will run at localhost:5001)"
Write-Output "---------------------------------------------------------------------------"
if($noServiceBuild) {
docker-compose -f ./compose/ges/docker-compose.ges.yaml -f $efile up
}
else {
docker-compose -f ./compose/ges/docker-compose.ges.yaml -f $efile up --build
}