aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2020-09-19 19:38:03 -0400
committerKylie McClain <kylie@somas.is>2020-09-19 19:38:03 -0400
commita647f6871fd118abc51dff5faff0d3adbdc27e23 (patch)
treebb11e441dbf75b6364b657275bac45577b20d467
parent600611bca1e511e312b0e4470b81cf6cb16e5043 (diff)
downloadgitolite-admin-a647f6871fd118abc51dff5faff0d3adbdc27e23.tar.gz
gitolite-admin-a647f6871fd118abc51dff5faff0d3adbdc27e23.tar.xz
gitolite-admin-a647f6871fd118abc51dff5faff0d3adbdc27e23.zip
Initial laminar hook
-rw-r--r--conf/gitolite.conf3
-rwxr-xr-xlocal/hooks/repo-specific/laminar23
2 files changed, 26 insertions, 0 deletions
diff --git a/conf/gitolite.conf b/conf/gitolite.conf
index 79b0667..64bd48f 100644
--- a/conf/gitolite.conf
+++ b/conf/gitolite.conf
@@ -9,9 +9,12 @@ repo @all
R = @export
option hook.post-receive.cgit-agefile = cgit-agefile
+
option hook.post-receive.irccat = irccat
option irccat.recipients = "#mutiny"
+ option hook.post-receive.laminar = laminar
+
owner = Kylie McClain
## Infrastructure
diff --git a/local/hooks/repo-specific/laminar b/local/hooks/repo-specific/laminar
new file mode 100755
index 0000000..57bb47d
--- /dev/null
+++ b/local/hooks/repo-specific/laminar
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+export LAMINAR_REASON="Push to git repository: '${GL_REPO}'"
+
+name="${GL_REPO}"
+name=$(printf '%s\n' "${GL_REPO}" | tr / -)
+
+job_exists() {
+ while [ $# -gt 0 ]; do
+ laminarc show-jobs | grep -q -E "${1}" || return 1
+ done
+}
+
+custom_job=$(gitolite git-config "${GL_REPO}" gitolite-options.laminar.job 2>/dev/null)
+
+if job_exists "^${name}($|-.*)"; then
+ laminarc start $(laminar show-jobs | grep -E "^${name}($|-.*)") || exit 1
+elif [ -n "${custom_job}" ] && job_exists "${custom_job}"; then
+ laminarc start "${custom_job}" || exit 1
+else
+ exit
+fi
+