Commit 34b4cc98 authored by Hiro's avatar Hiro 🏄
Browse files

Add script to download data and start the script

parent 324faa30
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ kept inside the same directory as the logs and trimmed automatically.
   cargo run --release
   ```

   Alternatively, `bin/start_tornado.sh` performs the download step and then
   launches the service using the same `cargo run` invocation (useful in
   container/packaged environments).

During execution the service prints progress as it discovers files, skips any
that failed to parse, and finally reports how many aggregated rows were inserted
into ClickHouse.

bin/start_tornado.sh

0 → 100755
+11 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
export WEBSTATS_DIR=${WEBSTATS_DIR:-"/app/data/store/webstats"}

"$REPO_DIR/bin/download_webstats.sh"

# Build & run the app via cargo
exec env APP_OPTS="${APP_OPTS:-}" /bin/sh -lc '. /usr/local/cargo/env && cd /app/src && exec cargo run --release --bin tornado -- $APP_OPTS'