repos
/ analytics-rust master

analytics-rust

mirror archived upstream

Single-binary self-hosted website analytics on Rust axum: collector API, dashboards, world map, and PDF reports.

analyticsaxumdockerrustself-hostedsqliteviteweb-analytics

600 B · 20 lines Raw History
 1#!/bin/sh
 2#
 3# For easy server deploys add this post-receive hook to your server in a bare
 4# repo somewhere like /srv/git/analytics/hooks/post-receive and make a git
 5# clone in /srv/docker/analytics. This script runs on push to rebuild and
 6# redeploy the docker container.
 7
 8while read oldrev newrev ref; do
 9  if [ "$ref" = "refs/heads/master" ]; then
10    unset GIT_DIR
11    START_TIME=`date +%s`
12    cd /srv/docker/analytics
13    git pull
14    docker-compose up --build --detach
15    docker system prune --force
16    END_TIME=`date +%s`
17    echo Total build time: `expr $END_TIME - $START_TIME`s
18  fi
19done