-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ps1
More file actions
28 lines (21 loc) · 896 Bytes
/
Copy pathdeploy.ps1
File metadata and controls
28 lines (21 loc) · 896 Bytes
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
# Deploys the linked project (or -ProjectRef): migrations, config, menu function.
# Needs a logged in cli. SUPABASE_DB_PUSH_BIN can point db push at another supabase.exe,
# see the version note in the README.
param(
[string]$ProjectRef
)
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
$refArgs = @()
if ($ProjectRef) { $refArgs = @('--project-ref', $ProjectRef) }
$dbPushBin = if ($env:SUPABASE_DB_PUSH_BIN) { $env:SUPABASE_DB_PUSH_BIN } else { 'supabase' }
Write-Host '==> db push (migrations)'
& $dbPushBin db push --yes @refArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host '==> config push (exposed schemas, auth)'
supabase config push --yes @refArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host '==> functions deploy: menu'
supabase functions deploy menu @refArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host 'Deploy finished.'