From 60cafb32fcb43db4789be1cc1e02cce3edae5ef8 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Thu, 19 Dec 2024 18:03:58 +0100 Subject: [PATCH] chore(dev): Make mprocs faster and installed automatically (#27052) Co-authored-by: Anders <754494+andehen@users.noreply.github.com> --- bin/mprocs.yaml | 5 ++--- bin/start | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/mprocs.yaml b/bin/mprocs.yaml index cb3761250d035..82409edab38f9 100644 --- a/bin/mprocs.yaml +++ b/bin/mprocs.yaml @@ -19,8 +19,7 @@ procs: shell: 'bin/check_kafka_clickhouse_up && bin/check_temporal_up && python manage.py start_temporal_worker' docker-compose: - shell: 'docker compose -f docker-compose.dev.yml up' - stop: - send-keys: [''] + # docker-compose makes sure the stack is up, and then follows its logs - but doesn't tear down on exit for speed + shell: 'docker compose -f docker-compose.dev.yml up -d && docker compose -f docker-compose.dev.yml logs --tail=0 -f' mouse_scroll_speed: 1 diff --git a/bin/start b/bin/start index ceaddede2140f..7ec881e57b81c 100755 --- a/bin/start +++ b/bin/start @@ -9,4 +9,14 @@ export HOG_HOOK_URL=${HOG_HOOK_URL:-http://localhost:3300/hoghook} [ ! -f ./share/GeoLite2-City.mmdb ] && ( curl -L "https://mmdbcdn.posthog.net/" --http1.1 | brotli --decompress --output=./share/GeoLite2-City.mmdb ) +if ! command -v mprocs &> /dev/null; then + if command -v brew &> /dev/null; then + echo "🔁 Installing mprocs via Homebrew..." + brew install mprocs + else + echo "👉 To run bin/start, install mprocs: https://github.com/pvolok/mprocs#installation" + exit 1 + fi +fi + exec mprocs --config bin/mprocs.yaml