romanzolotarev.com: support and find me elsewhere

Tested on OpenBSD 6.4 with stagit-0.8

Publish Git repositories with stagit(1) on OpenBSD

stagit(1) generates HTML files from your git repository. The source of this website, for example: /src/.

Install

Set up git and httpd, then install stagit.

# pkg_add stagit
quirks-3.16 signed on 2018-10-12T15:26:25Z
stagit-0.8:libssh2-1.8.0p0: ok
stagit-0.8:libgit2-0.27.2: ok
stagit-0.8: ok
#

Update Git repository

Add owner and description to the Git repository:

$ cd REPOSITORY.git
$ echo 'OWNER_NAME' > owner
$ echo 'DESCRIPTION' > description
$

Add post-receive hook to REPOSITORY.git/hooks/:

#!/bin/sh
set -e
dst="/var/www/htdocs/$(basename "$(pwd)" '.git')"

mkdir -p "$dst/src"
(cd "$dst/src" && stagit "$src")
cp -f "$dst/src/log.html" "$dst/src/index.html"

Check out my files: post-receive hook and style.css.

Test

To test post-receive hook push from your local host to the server:

$ git push REMOTE master
...
$

Patreon PayPal Vultr OpenBSD Amsterdam Mastering the Web