From 3e2d71d7b135cc6980cc10a4108130236734551e Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Fri, 30 Oct 2020 16:04:16 -0700 Subject: Initial version. --- examples/olamic-githook-post-receive | 23 +++++++++++++++++++++++ examples/olamic-run | 25 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 examples/olamic-githook-post-receive create mode 100644 examples/olamic-run (limited to 'examples') diff --git a/examples/olamic-githook-post-receive b/examples/olamic-githook-post-receive new file mode 100755 index 0000000..3135d0d --- /dev/null +++ b/examples/olamic-githook-post-receive @@ -0,0 +1,23 @@ +#!/bin/bash + +set -eu + +OLAMIC_QUEUE_HOST="${OLAMIC_QUEUE_HOST:-}" +OLAMIC_QUEUE_DIR="${OLAMIC_QUEUE_DIR:-/srv/olamic/queue}" +OLAMIC_GIT_REPO="${OLAMIC_GIT_REPO:-"$(git rev-parse --absolute-git-dir)"}" + +while read OLD NEW REF; do + if git rev-parse --quiet --verify "$NEW":olamic-run > /dev/null; then + OLAMIC_EMAIL="$(git show --no-patch --format=%ae "$NEW")" + echo -n "Enqueuing olamic run for $REF: " + if [[ "$OLAMIC_QUEUE_HOST" == "" ]]; then + olamic-enqueue "$OLAMIC_QUEUE_DIR" "$OLAMIC_GIT_REPO" "$NEW" GIT_REF="$REF" OLAMIC_EMAIL="$OLAMIC_EMAIL" <