From 2e2c4440cbdf967764aae22888df026bb1fc6a74 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 29 Jul 2019 19:08:45 -0400 Subject: checkout and run make --- Makefile | 12 ++++++++++++ hooks/post-receive | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71acace --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +all: build install reload + +.PHONY: build install reload + +build: + stack build --test + +install: + stack install + +reload: + systemctl --user reload anomic diff --git a/hooks/post-receive b/hooks/post-receive index 72dc81d..7f66079 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -15,5 +15,16 @@ warn() fi } +die() +{ + printf '%s: Error: %s\n' "$0" "$*" >&2 + exit 1 +} + GIT_WORK_TREE=. git checkout -f master -- authorized_keys.d/\* +export GIT_WORK_TREE=${GIT_DIR%.git} + +git checkout -f master || die 'command failed: git checkout' +cd "$GIT_WORK_TREE" || die 'command failed: cd $GIT_WORK_TREE' +make -- cgit v1.2.3