repos

blog.bythewood.me-flask

mirror archived upstream

Markdown blog on Flask with Vite-built assets and WeasyPrint PDF export, rewritten from the Wagtail build that preceded it.

blogdockerflaskmarkdownpythonself-hostedvite

717 B · 21 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/blog.bythewood.me/hooks/post-receive
 5# and make a git clone in /srv/docker/blog.bythewood.me. 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/blog.bythewood.me
14    git pull
15    docker-compose up --build --detach
16    docker system prune --force
17    END_TIME=`date +%s`
18    echo Total build time: `expr $END_TIME - $START_TIME`s
19  fi
20done