mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 11:17:50 +01:00
8f4df45984
Co-authored-by: Ben White <ben@posthog.com>
25 lines
555 B
Bash
Executable File
25 lines
555 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
|
|
|
|
cargo build
|
|
|
|
export RUST_LOG=${DEBUG:-debug}
|
|
SQLX_QUERY_LEVEL=${SQLX_QUERY_LEVEL:-warn}
|
|
export RUST_LOG=$RUST_LOG,sqlx::query=$SQLX_QUERY_LEVEL
|
|
|
|
export HOG_MODE=true
|
|
DATABASE_NAME=${DEBUG:-hoghooks}
|
|
export DATABASE_URL=postgres://posthog:posthog@localhost:5432/$DATABASE_NAME
|
|
export ALLOW_INTERNAL_IPS=true
|
|
|
|
sqlx database create -D "$DATABASE_URL"
|
|
sqlx migrate run -D "$DATABASE_URL"
|
|
|
|
./target/debug/hook-api &
|
|
./target/debug/hook-worker &
|
|
./target/debug/hook-janitor &
|
|
|
|
wait |