summaryrefslogtreecommitdiff
path: root/src/ci/git-pre-receive.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-10-08 08:26:37 -0300
committerEuAndreh <eu@euandre.org>2023-11-25 12:14:34 -0300
commite406d80377858f37ce683163b2b0ce45e59cfe9f (patch)
treeac2a4ba2543cc1b2507e8aa57acfc039e71cf3c8 /src/ci/git-pre-receive.sh
parentInitial empty commit (diff)
downloadasami-e406d80377858f37ce683163b2b0ce45e59cfe9f.tar.gz
asami-e406d80377858f37ce683163b2b0ce45e59cfe9f.tar.xz
Init server infrastructure files
Diffstat (limited to 'src/ci/git-pre-receive.sh')
-rwxr-xr-xsrc/ci/git-pre-receive.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ci/git-pre-receive.sh b/src/ci/git-pre-receive.sh
new file mode 100755
index 0000000..8cd83ee
--- /dev/null
+++ b/src/ci/git-pre-receive.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eu
+
+read -r _oldrev SHA _refname
+unset GIT_DIR
+
+if [ "$SHA" = '0000000000000000000000000000000000000000' ]; then
+ exit
+fi
+
+printf 'Upgrading post-receive hook...' >&2
+git show "$SHA":src/infrastructure/ci/git-post-receive.sh > hooks/post-receive
+chmod +x hooks/post-receive
+printf 'done.\n' >&2