-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
up.ps1
36 lines (28 loc) · 1.5 KB
/
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
Param(
[switch]$skipDeploy = $false,
[switch]$linux = $false
)
Write-Host "🚢 Starting Docker Compose"
docker compose up -d
if (-not $skipDeploy) {
Write-Host "⚙️ Restore dotnet tools"
dotnet tool restore
Set-Location $($Script:MyInvocation.MyCommand.Path | Split-Path)
if ($linux) {
Write-Host "⚙️ Building GordonBeemingCom Database AppDbContext Bundle"
dotnet restore --runtime 'linux-x64'
Set-Location ./src/
dotnet ef migrations bundle --project 'GordonBeemingCom.Database' --startup-project 'GordonBeemingCom' --force --context AppDbContext --output AppDbContextEfBundle
Write-Host "🚀 Deploying GordonBeemingCom Database AppDbContext Bundle"
. ./AppDbContextEfBundle --connection "Server=.,1600;Database=GordonBeemingCom;User Id=sa;Password=Password!@2;MultipleActiveResultSets=true;TrustServerCertificate=True;"
}
else {
Write-Host "⚙️ Building GordonBeemingCom Database AppDbContext Bundle"
dotnet restore --runtime 'win-x64'
Set-Location .\src\
dotnet ef migrations bundle --project 'GordonBeemingCom.Database' --startup-project 'GordonBeemingCom' --force --context AppDbContext --output AppDbContextEfBundle.exe
Write-Host "🚀 Deploying GordonBeemingCom Database AppDbContext Bundle"
. .\AppDbContextEfBundle.exe --connection "Server=.,1600;Database=GordonBeemingCom;User Id=sa;Password=Password!@2;MultipleActiveResultSets=true;TrustServerCertificate=True;"
}
Set-Location $($Script:MyInvocation.MyCommand.Path | Split-Path)
}