Tested on OpenBSD 6.4 and 6.5 with stagit-0.9.2p0

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.164 signed on 2019-07-27T11:44:10Z
stagit-0.9.2p0:libgit2-0.28.1: ok
stagit-0.9.2p0: 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
...
$

© 2008–2019 Roman Zolotarev  User Agreement  Privacy Policy