-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.ps1
32 lines (24 loc) · 837 Bytes
/
build.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
# Parent dir is root
$scriptDir = Get-Location
$rootDir = Split-Path -Path $scriptDir -Parent
$outDir = Join-Path -Path $scriptDir -ChildPath "/out"
## Backend
Set-Location $rootDir/certwarden-backend
# Include config example
Copy-Item -Path $rootDir/certwarden-backend/config.default.yaml -Destination $outDir
# Mandatory env flag for sqlite
$env:CGO_ENABLED = 1
# Windows x64
$env:GOARCH = "amd64"
$env:GOOS = "windows"
go build -o $outDir/certwarden.exe ./cmd/api-server
## Frontend
Set-Location $rootDir/certwarden-frontend
npx vite build
# remove old build
Remove-Item -Path $outDir/frontend_build -recurse
New-Item -ItemType Directory -Force -Path $outDir/frontend_build
# move to out
Move-Item -Path $rootDir/certwarden-frontend/dist/* -Destination $outDir/frontend_build
# Return to original path
Set-Location $scriptDir