0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 17:24:15 +01:00
posthog/rust/bin/start-hoghooks

25 lines
555 B
Plaintext
Raw Normal View History

#!/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