repos
/ status-django master

status-django

mirror archived upstream

Self-hostable uptime monitor and status page on Django: HTTP checks, Lighthouse audits, SEO crawls, and email and Discord alerts.

djangodockerhandcodedpythonself-hostedsqlitestatus-pageuptime-monitoringvite

747 B · 22 lines Raw History
 1#!/bin/sh
 2#
 3# For easy server deploys you can create add this post-receive hook to your
 4# server in a bare repo somewhere like /srv/git/status/hooks/post-receive
 5# and make a git clone in /srv/docker/status. This script will then run on
 6# pushing updates to the server to build and deploy new docker images.
 7
 8
 9while read oldrev newrev ref; do
10  if [ "$ref" = "refs/heads/master" ]; then
11    unset GIT_DIR  # unset GIT_DIR so that git pull works correctly
12    START_TIME=`date +%s`
13    cd /srv/docker/status
14    git pull
15    docker-compose up --build --detach
16    docker-compose run web python3 manage.py migrate --noinput
17    docker system prune --force
18    END_TIME=`date +%s`
19    echo Total build time: `expr $END_TIME - $START_TIME`s
20  fi
21done