#!/bin/bash

mkdir /home/Plausible
cd /home/Plausible

mix local.hex --force
mix local.rebar --force
mix deps.get --only ce
mix deps.compile

bun --cwd tracker i --no-save
bun --cwd tracker compile.js

mix assets.deploy
mix phx.digest priv/static
mix download_country_database
mix sentry.package_source_code

MIX_ENV=ce mix release plausible

MIX_ENV=ce _build/ce/rel/plausible/bin/plausible start