-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.ps1
executable file
·37 lines (33 loc) · 899 Bytes
/
run.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
# # check if a command exists
# function command_exists {
# param([string]$cmd)
# if (Get-Command $cmd -ErrorAction SilentlyContinue) {
# return $true
# }
# else {
# return $false
# }
# }
# cleanup
Remove-Item -Path ./build/ -Recurse -Force
# build
Write-Host "==> Build & Generate"
pnpm install; cargo run; pnpm build
# preview
pnpm preview
# # deploy
# $commands = @("docker", "podman")
# foreach ($cmd in $commands) {
# if (command_exists $cmd) {
# Write-Host "`n==> Deploy with '$cmd'`n"
# & "$cmd-compose" -p hymnal -f ./compose.yaml down
# & "$cmd-compose" -p hymnal -f ./compose.yaml up -d
# Write-Host "`n==> Open http://[::1]:8080 in your browser"
# exit
# }
# else {
# Write-Host "`n==> Warning: Command '$cmd' not found"
# }
# }
# Write-Host "`n==> Error: Deploymnet failed"
# exit 1