Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

646 B
Raw Blame
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
OUT_DIR="$ROOT_DIR/../../posthog/user_scripts"
UDFS=(
    decompress_udf
    json_drop_keys_udf
    json_clean_posthog_event_properties_udf
    json_strip_empty_strings_and_nulls_udf
)

cd "$ROOT_DIR"
go test ./...

for goarch in amd64 arm64; do
    case "$goarch" in
        amd64) suffix=x86_64 ;;
        arm64) suffix=aarch64 ;;
    esac

    for udf in "${UDFS[@]}"; do
        CGO_ENABLED=0 GOOS=linux GOARCH="$goarch" \
            go build -buildvcs=false -trimpath -ldflags "-s -w" -o "$OUT_DIR/${udf}_${suffix}" "./cmd/$udf"
    done
done