Init
This commit is contained in:
25
scripts/build.sh
Executable file
25
scripts/build.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
echo "Building frontend..."
|
||||
cd "$ROOT_DIR/frontend"
|
||||
bun install
|
||||
bun run build
|
||||
|
||||
echo "Copying frontend dist to backend embed location..."
|
||||
rm -rf "$ROOT_DIR/backend/cmd/server/frontend_dist"
|
||||
cp -r "$ROOT_DIR/frontend/dist" "$ROOT_DIR/backend/cmd/server/frontend_dist"
|
||||
|
||||
echo "Copying migrations to backend embed location..."
|
||||
rm -rf "$ROOT_DIR/backend/cmd/server/migrations"
|
||||
mkdir -p "$ROOT_DIR/backend/cmd/server/migrations"
|
||||
cp "$ROOT_DIR/backend/migrations"/*.sql "$ROOT_DIR/backend/cmd/server/migrations/"
|
||||
|
||||
echo "Building backend..."
|
||||
cd "$ROOT_DIR/backend"
|
||||
go build -o "$ROOT_DIR/server" ./cmd/server
|
||||
|
||||
echo "Build complete: ./server"
|
||||
Reference in New Issue
Block a user