repos
/ repos-rust master

repos-rust

mirror archived upstream

A minimal self-hosted git browser on Rust axum: bare repos rendered as a website with commits, diffs, syntax-highlighted blobs, atom feeds, and clone over HTTPS.

axumdockergitgit-browsergitoxidegixrustself-hosted

969 B · 28 lines Raw History
 1#!/bin/sh
 2#
 3# post-receive hook generated for repos by taproot's quickstart.sh.
 4# Lives on the alpine server at /srv/git/repos.git/hooks/post-receive.
 5#
 6# Identical to every other project's hook: pull, rebuild, reattach to the
 7# shared bythewood-edge network so Caddy can find us.
 8
 9while read oldrev newrev ref; do
10  if [ "$ref" = "refs/heads/master" ]; then
11    unset GIT_DIR
12    START_TIME=$(date +%s)
13    cd /srv/docker/repos
14    git pull
15    docker compose up --build --detach
16    # Reattach every container in the project to the shared edge network.
17    # Resolved via `compose ps` (not `repos`) so this works regardless
18    # of the compose service name or container_name override.
19    for cid in $(docker compose ps -q); do
20      docker network connect bythewood-edge "$cid" 2>/dev/null || true
21    done
22    docker container prune --force
23    docker image prune --force
24    END_TIME=$(date +%s)
25    echo "Total build time: $((END_TIME - START_TIME))s"
26  fi
27done