aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2021-06-24 15:43:19 -0400
committerKylie McClain <kylie@somas.is>2021-06-24 15:43:19 -0400
commitf649d6ae1b658fb90c8604bf1b58600baebd1f26 (patch)
tree74106e2f2a4c49b9d024f50a7b0a42328767dc78
parent84929421576454a114ca48ab0b29d9249a5015ec (diff)
downloadgitolite-admin-f649d6ae1b658fb90c8604bf1b58600baebd1f26.tar.gz
gitolite-admin-f649d6ae1b658fb90c8604bf1b58600baebd1f26.tar.xz
gitolite-admin-f649d6ae1b658fb90c8604bf1b58600baebd1f26.zip
laminar: turn laminar job output into a url
-rwxr-xr-xlocal/hooks/repo-specific/laminar10
1 files changed, 8 insertions, 2 deletions
diff --git a/local/hooks/repo-specific/laminar b/local/hooks/repo-specific/laminar
index f4fbc86..ede08ce 100755
--- a/local/hooks/repo-specific/laminar
+++ b/local/hooks/repo-specific/laminar
@@ -1,5 +1,7 @@
#!/bin/sh
+set -eu
+
export LAMINAR_REASON="Push to git repository: '${GL_REPO}'"
name="${GL_REPO}"
@@ -15,10 +17,14 @@ job_exists() {
custom_job=$(gitolite git-config "${GL_REPO}" gitolite-options.laminar.job 2>/dev/null)
if job_exists "^${name}($|-.*)"; then
- laminarc start $(laminarc show-jobs | grep -E "^${name}($|-.*)") || exit 1
+ job=$(laminarc show-jobs | grep -E "^${name}($|-.*)")
elif [ -n "${custom_job}" ] && job_exists "${custom_job}"; then
- laminarc start "${custom_job}" || exit 1
+ job="${custom_job}"
else
exit
fi
+started=$(laminarc start "${job}")
+started_url=$(printf %s "${started}" | tr : /)
+started_url=$(printf 'https://ci.mutiny.red/jobs/%s\n' "${started_url}")
+printf 'Started laminar job:\n\t%s\n' "${started_url}"